Win a copy of Head First Android this week in the Android forum!

Sandeep Shukla

Greenhorn
+ Follow
since Oct 21, 2004
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 Sandeep Shukla

String s1 = "spring "; # 1
String s2 = s1 + "summer ";#2
s1.concat("fall "); #3
s2.concat(s1);#4
s1 += "winter ";#5
System.out.println(s1 + " " + s2); #6

//net 6 ....(as + and concatenation operations are stringbuffer operations and the final thing is converted to string)
17 years ago
when i create a object( say a hashmap object) , is that object lifecycle limited to the method call or is this object available for garbage collection.
another doubt which springs into my mind...what all objects are really eligible for garbage collection?
17 years ago
when i create a object( say a hashmap object) , is that object lifecycle limited to the method call or is this object available for garbage collection.
another doubt which springs into my mind...what all objects are really eligible for garbage collection?
17 years ago
one way to define a singleton pattern is to make the construtor private and give a synchronized static handle to a private instance of the class.

Is there any other way of implementing a singleton?
class A implements Interf,Serializable

A is serialized
Then A is to be deserialized



A is removed from class path
//Map it to obect
Object o = in.readObject()
OR
Map it to interface Interf
Interf c =(Interf) in.readObject()

tell me w.r.t compile time and run time errors, if any
17 years ago