Puneet Nahata

Greenhorn
+ Follow
since Aug 30, 2008
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 Puneet Nahata

Hi all,

I am planning to appear for SCJP around 2nd week of Oct(strict deadline). I have read K&B 5 and i am fairly comfortable in solving practice Q's.

However now i am in dilemma now weather to go for 5 or 6. i have seen that difference between two exams is not big. But till today i have no knowledge of additional topics of 6. How should i prepare for additional topics in 6.
Should i buy K&B 6 for preparation (I have K&B 5)??

online links to extra topics for 6 would be highly appreciated.

Thanks!

Originally posted by kumar ankit:
thanks Lok

but i think you have taken Date as java.util.Date but in sql you have to take java.sql.Date.



You should always use java.util.Date throughout your application. However, when making call to database, use this method for converting java.util.Date to java.sql.Date.

15 years ago
Though the code looks like we are instantiating and abstract class but this is not what is happening. It is an anonymous inner class.



The object referenced by the variable t is a instance of an anonymous subclass of AbstractTest.
[ September 04, 2008: Message edited by: Puneet Nahata ]
I think you are confused with the options. D,E,F,G are not possible.
Consider option E. It says "Both C1 and C3 are required". But actually either of them will suffice(though there is no harm if you apply both options while testing in code. It will work fine.)


Originally posted by Sambit Banerjee:
Bert,as you have asked for my jdk version i thought i have a problem with it.So,i have checked it in my friend's pc and i found no problem with Integer.parseInt(arg).
But i have checked the options also and still find that except option b all the options compile the code.
Here's the exact code.

Originally posted by Sirisha Ghatty:

"When searching for class files, the java and javac commands don't search the current directory by default.



First Sentence says: while searching for class files.
The class here is MusicPlayer.class, which you are explicitly providing in compile option: java -cp classes player.MusicPlayer

Rest is all folder navigation.
So the conclusion is that if we pass an Object reference to a method then that object will never be eligible for garbage collection inside that mehtod.

But if we pass an actual object, then that object can be eligible for garbage collection inside that method.

Am i right??
public void getObject(Object a)
{
Object c, b = new Object(); //1
//do something with a
c = b; //2
a = c;//3
b = a = null; //4
c = null;
while(true){}
}

and the call to this method is: getObject(new Object())

Since this method call would never return, that means Object a will never be eligible for garbage collection. Am i right???
Or is it eligible for garbage collection at line 3???

Please clarify my doubt.

Originally posted by snehasish barman:
...when the memory is full what message the JVM provides if anything is to be added to the memory???



No. JVM dose not provide any suggestion for upgrading system memory.
I think you are right.

Either
MyJar.jar should be present in classpath
OR
"java -classpath MyJar.jar GetJar" command should be used.