Archive for the ‘Java’ Category

When we create any object using new keyword, some amount of memory will be allocated. Once we done with that object, it should be removed from the memory. Java implements automatic memory management also known as Garbage collection. It will automatically recycle the dynamically allocated memory. Garbage collector will recycle the memory.

Garbage collection was first invented by John McCarthy in 1958 as part of the implementation of Lisp..

Garbage collection organizes objects into generations (Young, Tenured and Perm).. (more…)

Read Full Post »

I would like to thank this Forum for the precious information I got from it as well as to Mikalai Zaikin as well as to Java Ranchers..

I would like to share my experience and materials which I have used for SCEA preparation..Firstly, I am having 2 yr 10 months experience. Those who are having exp less than 4 yrs ,I would suggest them to finish these certifications (SCWCD, SCBCD & SCDJWS for J2EE 5) , though it’s not mandatory, but it helps you to gain more knowledge. If you are 5 + exp, then its easy to clear this exam..Exam contains only scenario based questions and we need to select an appropriate answer. It’s quite difficult for me, to choose those answers 😥 . Don’t go for most powerful and new ones instead read the question carefully and address the requirements. For example, sometime two-tier architecture will be better than 3-tier, DAO over JPA, RMI over web services (it depends on our requirements )..

Read Full Post »

Preparation tips & links: (for 1st round interview) –Basic stuffsss …. More to add on… All d best!!!

*) Basic flow architecture of java – Read abt JVM, why we need JRE, Where we will be using JIT, CLASSLOADER workflow..

*) We should be good in core java concepts.. I would prefer to read Kathy serria (SCJP book).. Its not mandatory to take this SCJP exam, but its better to read this book atleast once and be familiar with all the topic.. Concentrate more on Threads,Generics & Collections (especially HashMap implementation).. I would urge you to code as much as possible.. Understand HashCode concept, implement a simple HashMap (what will happen if collision occurs in HashMap) , LoadFactor, rehash ,running time complexity(O(1)) .. Please check the source code of HashMap.java

*) Annotation – how to create a simple annotation (@Retention(RetentionPolicy.RUNTIME)) (more…)

Read Full Post »

How to create a dynamic class “on the fly” :

com.sun.tools.javac.Main class has two methods which help us to invoke the compiler from a program. It will behave like javac command.
public static int compile(String []args);
public static int compile(String []args , PrintWriter out);

args-> command line arguments that would be normally be passed on the javac program.
out-> indicates where the compiler’s output is directed.
return (int) -> exit value

I would like to share a simple program which will create a java file on the fly (ie at Runtime) and it will be compiled using compile method provided by this class com.sun.tools.javac.Main.Once its  been compiled,using reflection apis we will invoke the method in the class(which is created at Runtime).. (more…)

Read Full Post »

Java -Dis@$$emble

This material -> It would be helpful for java interview for sure (for Product company 🙂 ) .. Its bit lengthy, I will try to modify this material.. Even I hate to read big paragraph, first time I took some notes and created a simple doc..  I am glad to share this with you all..

Till now, I didn’t concern about the details of what happened to the source code when it’s run through the compiler. I would like to share my findings (behind the scene details).

Javap utility is used to disassemble java bytecode (ie binary format into readable format) .This utility is included in Jdk . (more…)

Read Full Post »


    *Only one instance of class will be created

    Consider this class
    public class Singleton

Read Full Post »

Java Interview:

Prod Comp 2 :[2+yr][Programmer][Dec-2009]

I am glad to say that, I have cleared this interview(I got confirmation from this company).

Apart from telephonic interview, never messed up anywhere,
Be cool n relax, that’s d mantra…. Be confident, don’t be over confident..


Read Full Post »

Older Posts »