gunjan khanuja

Ranch Hand
+ Follow
since Apr 16, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by gunjan khanuja


Thanks all,
I read Kathy Seirra Book which totally focusses on the concepts(Wonderful book),did the self Tests from that book itself,gave two mock tests on certpal.com(Do watch out what mistakes you do),
and reached out many other websites like Niko's Blog(to revise basic things, section wise),Scjptest.com,javagenious.com, etc to name a few
and other sources of mock tests posted on java ranch itself.
Clearing my doubts on javaranch community was really helpful..Please make sure you clear your doubts as you will learn something new from every other doubt you have
TIP::Practice as many questions as you can from whatever source(ONLY after reading the book) beacuse only reading concepts wont help.Applying them on n number of questions
will help memorizing them and
make learning much better and easier.
11 years ago
Yesterday I cleared My SCJP Certification with 100% .
Thanks to all java ranchers who helped clearing my Doubts...
11 years ago


This is the question from book.Please explain all the options as to why they are and why they are not the answers for this question?
Which allows B.java to compile? (Choose all that apply.)
A. Set the current directory to xcom then invoke
javac B.java

B. Set the current directory to xcom then invoke
javac -classpath . B.java

C. Set the current directory to test then invoke
javac -classpath . xcom/B.java

D. Set the current directory to test then invoke
javac -classpath xcom B.java
E. Set the current directory to test then invoke
javac -classpath xcom:. B.java
Can anybody please explain how to use the -cp commands to find classes under different packages .I have read the kathyBB book
but i could not understand it clearly.


Why adding drip object the second time gives me exception??Please explain what happens when i add drip object for the first time and when i add drip object the second time
11 years ago

please explain why the thread is still not considered alive if the start method is called on the thread and run() will be called by start itself?
but if the hashcode generated is unique,though the value of string is same..,wont it be added?

Code snippet 1:




In the code snippet 1 :why we do not get the size as 2.I feel the size should be 2 because the hashcode method has not been overidden so some unique hashcodes are created by JVM.So both the elements should get added.please correct me if i am wrong?
The first version gets called but why is that so ?why the method with var-args is not called??
method(2,3) invokes which of the methods given below and WHY ??

Which can appropriately be thrown by a programmer using Java SE technology to create
a desktop application?
A. ClassCastException
B. NullPointerException
C. NoClassDefFoundError
D. NumberFormatException
E. ArrayIndexOutOfBoundsException

Please expalin what is the answer and WHY??
i ran the code using both the statements and i got this error..Please clarify


D:\Mobility\eclipse\workspace_abhijeet\Propagate\src\com\tcs>java Propogate
Exception in thread "main" java.lang.NoClassDefFoundError: Propogate (wrong name



: com/tcs/Propogate)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Propogate. Program will exit.

D:\Mobility\eclipse\workspace_abhijeet\Propagate\src\com\tcs>java Propogate.clas
s
Exception in thread "main" java.lang.NoClassDefFoundError: Propogate/class
Caused by: java.lang.ClassNotFoundException: Propogate.class
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Propogate.class. Program will exit.

D:\Mobility\eclipse\workspace_abhijeet\Propagate\src\com\tcs>




can anybody please explain what to do when this program is run through Command prompt.I get this output after i compile and run this program in cmd.
java propogate???Please explain?


Exception in thread "main" java.lang.NoClassDefFoundError: Propogate/class
Caused by: java.lang.ClassNotFoundException: Propogate.class
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Propogate.class. Program will exit.
should an abstract class implementing an interface define all the methods of the interface??


Can a class implementing an interface overload the methods of the interface??