ms

Greenhorn
+ Follow
since Oct 18, 2000
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 ms

Thanks a lot Jane . I was not aware of the naming policy and I have re registered myself . Here just to maintain the identity I am following the same id .
Just wanted to know that if the object re -refers itself in the finalize method ...Will it ever be garbage collected ?
Thanks in advance again !
Thanks a lot Vaidraj ,
Actually I read these two questions in one mock test and it was said that that first time the object will not be garbage collected but second time the GC will ignore finalize and the object will be garbage collected .I could not understand the logic .
Thanks a lot Lam for a detailed note .
Want to just check on one issue :
Do u mean to say that when we make a literal in String pool ....a new String instance is created at the heap .Then why does the result for two string literals say s1 and s2 comes out to be true
Example :
String s1 = "Hello" ;
String s2 = "Hello" ;
s1 == s2 ... gives true
Their behaviour should also be like String objects ?

2nd Point :
As per you :
WHen I declare String literal :
String b = "bye" ;
String c = b + "!" ;
It will be resolved as (object pointed by refrence b) + "!"
for once which will evaluate as bye! and assigned to refrence c
at compile time .After this b has no relevance in the c's context .
AmI right in my understanding !
Hope am not that ambiguous !
Hi all ,
The 8859-1 character code for the uppercase letter A is 65. What would be the right way to declare and initialize a variable of type char with this value?
Thanks in advance ,
MS
22 years ago
Hi ,
1) If in finalize method we make re refrence to the object .Will that object ever be garbage collected.
2) Is it mandatory to call the base class finalize method in the subclass's finalize method else the compiler will give compile time error .

Hi all ,
Can somebody tell me the correct answer and explain why is that so ?
Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done?
public class Q76a9 {
static String f() {
String a = "hello";
String b = "bye"; // (0)
String c = b + "!"; // (1)
String d = b;
b = a; // (2)
d = a; // (3)
return c; // (4)
}
public static void main(String args[]) {
String msg = f();
System.out.println(msg); // (5)
}
}
Thanks a lot ! I am clear now .
23 years ago
Hi ,
I have been also trying hard to be able to execute my code from anywhere but I am unable to do so :
PATH=%PATH%;C:\MSSQL7\BINN;C:\JDK1.3\BIN;C:\myclasses;
SET CLASSPATH = .;%CLASSPATH%;C:\JDK1.3\SRC.JAR;C:\myclasses
My files are lying in c:\myclasses
If I try to compile from the root directory C . It gives me an error that file not found .
I tried putting
package myclasses ;
as the first line of the java file so that compiler can know it is myclasses.filename.java but still it is giving me an error .
Can u please help me where am i going wrong in my understanding !
Shall be thankful to you .
23 years ago
Hi all ,
Can you please tell me that can we downcast in Java or it always throws the ClassCastException .
If it does can you please suggest the appropriate code for that .

Shall be extremely thankful !
23 years ago
Even i am confused about this ?? If scheduler does everything then why do we have priorties ??