geekexplains Profile

Join Date:

Blogs Owned

It aims to help people understanding their concepts/solutions better in Java, J2EE, Oracle, C/C++,.. OOP, Web App Development, UML, Puzzles, Best Practices, Technical and HR Interview Questions, and.. Useful Hacks/Tips.

Visit Follow

Other Tags: Java, Oracle, Multithreading, Technical Interview Questions, Tips

Latest Blog Posts

  • Why String has been made immutable in Java?
    on Nov 28, 2009 in Java
    Why String has been made immutable in Java?Though, performance is also a reason (assuming you are already aware of the internal String pool maintained for making sure that the same String object is used more than once without having to create/re-clai...
  • Memory Leak in Java? Does 'static' cause it?
    on Nov 17, 2009 in Java
    Does 'static' cause Memory Leak in Java?What's memory leak? In simple terms, it's unused but referenced (somehow because the programmer probably unintentionally forgot to remove the references once the use of the object was over) part of the memory.
  • Marker Interface in Java: what, why, uses, etc.
    on Oct 29, 2009 in Java
    What are Marker Interfaces in Java?An empty interface having no methods or fields is called a marker interface or a tag interface. There are few Java supplied marker interfaces like Cloneable, Serializable, etc. One can create their own marker interf...
  • Connecting to an HTTP Web Service from VBA via Proxy
    on Oct 13, 2009 in Miscellaneous
    Connecting to an HTTP Web Service from VBA Excel via a Proxy ServerThough MSDN suggests using stubs generated from the WSDL by MS Soap Toolkit for connecting to an HTTP Web Service from within VBA Excel, but it might not work as you would like it to,...
  • Why wait(),notify() and notifyAll() in the Object class?
    on Oct 11, 2009 in Java Multithreading
    Why wait(), notify() and notifyAll() methods have been defined in the Object class?Java concurrency model uses locks to implement mutually exclusive access to objects in a multi-threaded environment and locks are associated with every object in Java...
  • per-thread Singleton and per-thread Logging in Java
    on Aug 3, 2009 in Java Multithreading
    Usage of ThreadLocal: per-thread Singleton and per-thread LoggingShould you require a refresh of what ThreadLocals in Java are and how they work, refer to this article first. You can then proceed with the current article for understanding two of the...
  • Choosing the Most Specific Method - Tricky Overloading
    on Jun 18, 2009 in Java
    Choosing the Most Specific Method - Tricky Method OverloadingLet's start with looking at a code-segment and try to think of the output/error, it would produce when compiled/executed and subsequently we'll discuss the behavior of code.public class Nul...
  • Initializer Blocks & their alternatives in Java
    on Jun 11, 2009 in Java
    Initializer Blocks in Java and their possible alternativesInitializer Blocks - what are they, why & how are they used?These blocks are similar to the static initialization blocks with the only difference being the absence of the 'static' keyword.
  • Static Initialization Blocks & their alternatives
    on Jun 6, 2009 in Java
    Static Initialization Blocks and their alternatives in JavaWhy do we need Static Initialization Blocks?The easiest way of initializing fields (static or instance) in Java at the time of their declaration is simply by providing a compile time constant...
  • Choosing a suitable access control modifier in Java
    on May 30, 2009 in Java
    How to choose a suitable access control specifier of a method or a field?Access Control Modifiers available for classes and members in JavaTop-level classes in Java can have only two access control modifiers - public and default (package-private) whe...
  • Finding caller of an instance or static method in Java
    on May 28, 2009 in Java
    Finding Caller object, method/class of an instance method in JavaYou might think if we would ever need it? Well... you may never, but no harm in exploring whether we have any/some ways of finding this in Java or not. This question was asked by one of...
  • Passing '\n' (new-line) on command line in Java
    on May 24, 2009 in Java Miscellaneous
    Can we pass a new-line ('\n') character or any other escape sequence via command line in Java?One of our visitors (Vivek Athalye) asked this in response to the article - Tricky use of static initializer block. Thought of posting the answer as a separ...
  • Tricky use of static initializer in Java - Override println
    on May 9, 2009 in Java
    Can we get a different output without changing the main-method definition?public class HelloMain {/*** @param args*/public static void main(String[] args) { System.out.println("Mr. main.");}}Can we have the output of the above code-segment...
  • Binary rep of negative numbers in Java - 2's complement
    on May 3, 2009 in Java Miscellaneous
    2's Complement: Binary representation of negative numbers in JavaNegative numbers in Java are represented using 2's complement. As we know that integers in Java occupy 4 bytes so to understand how a negative integer (say -4) is represented internally...
  • Finding if a number is a power of 2 or not in Java?
    on May 3, 2009 in Java Algorithms
    How to find whether a number is a power of 2 or not in Java?There can be many possible solutions to this problem, but probably the most efficient remains to be the one which uses bit-level manipulation wisely.We'll talk about only that solution here...
  • Puzzle: Circular Table, Pile of Quarters and 2 Players
    on May 2, 2009 in Puzzles
    Puzzle: There is a huge pile of quarters and a circular table. There are two people to play a game of placing the quarters down on the table alternately without any overlap. The one who can't put down a quarter loses. Assuming that the pile of quarte...
  • Viewing/Editing PPT, Doc, TIFF, etc. in your browser
    on May 2, 2009 in Miscellaneous
    Viewing/Editing files without having the required s/w or tools installedWonder what will you do in case you end up getting caught in a situation where none of the widely used tools/softwares (such as MS Office, Flash, File Viewers/Editors like Acroba...
  • Implementation of SAX Parser in Java using SAX2 APIs
    on Apr 11, 2009 in Java
    For those who have reached to this article directly, before we move on to discussing the implmenetation of a sample SAX-based XML parser in Java, they may like to refresh their understanding of SAX by referring to this article - Evolution of Java and...
  • Sax, DOM, JAXP, & JDOM. Evolution of Java-XML combo.
    on Mar 31, 2009 in Java Miscellaneous
    Evolution of the XML Parsing/Manipulation using Java The combination of Java and XML has been one of the most attracting things which had happened in the field of software development in the 21st century. It has been mainly for two reasons - Java, a...
  • SAX v/s DOM. How to choose between DOM and SAX?
    on Mar 31, 2009 in Miscellaneous
    Differences between DOM and SAX. When to use what?  Before going through the differences, if you need a refresh of what SAX and DOM are, please refer to this article - SAX, DOM, JAXP, & JDOM >>. While comparing two entities, we tend to see...