This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Explanation needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Explanation needed" Watch "Explanation needed" New topic
Author

Explanation needed

arivu mathi
Ranch Hand

Joined: Jun 26, 2006
Posts: 38
class B {
private String name;
public B(String name) {this.name = name;}
public String toString() {return name;}
protected void finalize() {System.out.print(name);}
}
class J {
static B bc;
static int i = 1;
static B m1(B b) {bc = b; return new B("B" + i++);}
public static void main (String[] args) {
B x = m1(new B("Ba")), y = m1(new B("Bb"));
System.out.println(", " + x + ", " + y + ", " + bc);
}}
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please use tags to enclose formatted code.

What do want an explanation about? A compile error? An exception at runtime? Unexpected output? Have you even attepted to compile this code? Run it?

In other words: ShowSomeEffort
[ July 19, 2006: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Sujittt Tripathyrr
Ranch Hand

Joined: Jun 21, 2006
Posts: 96
what you want from the code please specify clearly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Explanation needed
 
Similar Threads
Que regarding Dan's Exam
Danchisholms: GC question, answer mismatch
Unexpected output is coming..
Garbage collection questin from Danchisolm
Garbage collection