Win a copy of Machine Learning with TensorFlow this week in the Artificial Intelligence and Machine Learning forum!

Yogi Gupta

+ Follow
since Apr 21, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yogi Gupta

The answer is and should be A. Well its so because System.out.println(this.str); would refer to t.str, t which has been declared in the main method. If however in the main method if this is present t.str="0"; then it would print the option D

Scope of variable t defined in the main method is limited to main method only. It can not be accessed outside the method. System.out.println(t.str) would refer to the static variable t defined earlier and thus it will print null.
Dear All,
Below is the javadoc comment for parseLong method:
Parses the string argument as a signed decimal long. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' (\u002D') to indicate a negative value. The resulting long value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseLong(java.lang.String, int) method.
Note that neither the character L ('\u004C') nor l ('\u006C') is permitted to appear at the end of the string as a type indicator, as would be permitted in Java programming language source code.

Hope it is clear now.
Hi All,
Pls go through the code below :

As per my understanding, the output of the above should be "Inside class Q4" but it is not. Can anyone explain this to me ?
thanks in advance,
Edited by Corey McGlone: Added Code Tags
[ May 06, 2003: Message edited by: Corey McGlone ]
I would like to appear for SCJP but not able to decide about the exam I should go for ? 1.4 or 1.2 ?
Thanks in advance,