Archive for the ‘Java’ Category

Java interview questions:

I would like to share my interview exp with 2 product company situated in India..I am glad to say that, I have cleared both the interviews(I got confirmation from both company).. I will share those interview questions, so that it would be helpful for our preparation. Even though I have cleared the interview, I am looking forward to work in a project where it will involve some innovation.

Certifications help me a lot… Those who love java, I would request them to take Sun certification..It will help us to understand the concepts as well as its Pros & Cons.

Soon I will update the answers; at least I will give the pointers for the solutions…

Prod Comp 1:[2+ yr][Programmer][Jan-2010] (more…)

Read Full Post »

Java Virtual Machine:

Main purpose : To run the compiled Java code across different network with out any modification.

Jvm doesn’t know abt Java language, it accepts only particular format (.class).A class file contains Java virtual machine instructions (bytecode) and a symbol table  as well as ancillary information.It can also be used to run other languages other than java.For example , Ada source code can be compiled to java bytecode and it can be executed by JVM.JVM executes .class files ,by using interpreter to emulate the instruction set or by using Just-in-Time compiler(JIT). JIT will not interpret and its used in most JVM to achieve greater speed.

JIT will convert bytecode into native machine code , thus it will improve the performance as well as it will caches the results of translating blocks (so it avoid reevaluating each line or operand each time it is met)..

How JVM Works :
-> Class will be loaded using ClassLoader(it will find the binary representation of classes).. (more…)

Read Full Post »

We can access private variable of super class or any class using reflection api. I have created a sample class which will change the value of private variable to the new value. You need to set accessible flag as true in setAccessible() method of Field reflection class, then only it will allow us to read/change the private variable . There is one more way to suppress the access using SecurityManager class.

Read Full Post »


ClassLoader is responsible for finding and loading class file at run time.ClassLoader class is located in java.lang package.we can subclass it to our functionality for class loading

Whenever a new JVM is started ,
> Bootstrap class loader is responsible for loading java classes like java.lang.Object and other runtime code into memory first.Runtime classes are in rt.jar file
>next comes java extension class loader(path java.ext.dirsExtClassLoader).
here we can place our .jar files since it will be loaded automatically when jvm starts
>lastly ,AppClassLoader which will load classes kept in the java.class.path System property


Read Full Post »

« Newer Posts