M
Madhur Ahuja
Hello
My instructor gave me some sample viva questions.
Some of the questions, were quite odd.
I have searched the net for their answers, I just decided
to post them here, to get ideas of your people.
Q. What is the data structure used in the garbage collection
scheme of java[ or perhaps sun's jvm].
A. I have found that, implementation of garbage collection is
implementation dependent. java specification only specifies
what is garbage collection and not what algorithm to apply.
As regard of sun's jvm, i have found that it uses
*reference counting collectors* algorithm to find out unused
objects.
Q. How is the memory map of a static variable, different from that
of non static variable.
A. This one is quite odd. I think it depends on the OS,platform
etc. In short one can say that only one copy of static variable is
maintained for a class having multiple instances.
Q. Can you override public static void main method?
A. No. Since it is a static method. Although no error will be
generated.
Q. What is the latest version of J2EE
A. Same as JDK I think? 1.5 or JSDK 5.0
Q. What is the meaning of 2 in J2SDK and 1,4 in Java 1.4
A. This confuses me lot. Perhaps anyone can help in this case. Also
the latest 1.5 has been termed as 5.0.
Q. What do u know about drafts,specifications of J2SE?
A. Drafts? no idea about this. Perhaps these are same as versions.
Q. What are the components of JFC?
A. Swing, AWT.
Q. What are the disadvantages of Swing over AWT?
A. Might be little slow.
Q. What are the major changes in java from versions 1.1,1.2,1.3,1.4
A. Although the answer of this question is best found on the Sun's site.
My instructor told that he was interested in the version groups of java.
For ex, 1.1-1.2 is regarded as similar java version while 1.3-1.4 is
regarded as another equal java version. Has anyone ideas on this?
Q. There is a famous trick in java programming to prevent the
decompilation of your .class files(may be not successful).
what is that trick?
A. I have found about "encrypting the class files and decrypting them
while loading through a custom classloader inside the JVM". This
fails due to a API, which directly takes the unencrypted class files
as an argument.(taken from the www.javaworld.com)
My instructor gave me some sample viva questions.
Some of the questions, were quite odd.
I have searched the net for their answers, I just decided
to post them here, to get ideas of your people.
Q. What is the data structure used in the garbage collection
scheme of java[ or perhaps sun's jvm].
A. I have found that, implementation of garbage collection is
implementation dependent. java specification only specifies
what is garbage collection and not what algorithm to apply.
As regard of sun's jvm, i have found that it uses
*reference counting collectors* algorithm to find out unused
objects.
Q. How is the memory map of a static variable, different from that
of non static variable.
A. This one is quite odd. I think it depends on the OS,platform
etc. In short one can say that only one copy of static variable is
maintained for a class having multiple instances.
Q. Can you override public static void main method?
A. No. Since it is a static method. Although no error will be
generated.
Q. What is the latest version of J2EE
A. Same as JDK I think? 1.5 or JSDK 5.0
Q. What is the meaning of 2 in J2SDK and 1,4 in Java 1.4
A. This confuses me lot. Perhaps anyone can help in this case. Also
the latest 1.5 has been termed as 5.0.
Q. What do u know about drafts,specifications of J2SE?
A. Drafts? no idea about this. Perhaps these are same as versions.
Q. What are the components of JFC?
A. Swing, AWT.
Q. What are the disadvantages of Swing over AWT?
A. Might be little slow.
Q. What are the major changes in java from versions 1.1,1.2,1.3,1.4
A. Although the answer of this question is best found on the Sun's site.
My instructor told that he was interested in the version groups of java.
For ex, 1.1-1.2 is regarded as similar java version while 1.3-1.4 is
regarded as another equal java version. Has anyone ideas on this?
Q. There is a famous trick in java programming to prevent the
decompilation of your .class files(may be not successful).
what is that trick?
A. I have found about "encrypting the class files and decrypting them
while loading through a custom classloader inside the JVM". This
fails due to a API, which directly takes the unencrypted class files
as an argument.(taken from the www.javaworld.com)