What is the latest version of ClearCase for file version control.
thank you guys
Printable View
What is the latest version of ClearCase for file version control.
thank you guys
no comments
How to create muliple instance of a SingleTone class?I want to create three instance of a SingleTone class.My code is like this:
class SingleTone{
private static final SingleTone[] obj = new SingleTone[3];
private SingleTone(){
}
public static SingleTone[] getInstance(){
for (int i = 0 ; i<3 ;i++){
obj[i] = new SingleTone();
}
return obj ;
}
void method(){
System.out.println("This is a SingleTone class's method");
}
}
public class MySingleTone {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 0 ; i<3 ;i++){
SingleTone[] o = SingleTone.getInstance();
System.out.println("Object o:" + o[i]);
}
SingleTone[] o = SingleTone.getInstance();
System.out.println("Object o:-->" + o[0]);
}
}
Problem is : when I prints:
//last line
System.out.println("Object o:-->" + o[0]);
Its shows other object reference,How can I make it same.[/QUOTE]