aspose file tools*
The moose likes Product and Other Certifications and the fly likes wrong output? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "wrong output? " Watch "wrong output? " New topic
Author

wrong output?

pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188



public class Test7{
public Test7(){}
public Test7(Test7 ref){
this (ref,"Hai");
}
public Test7(Test7 ref,String str){ /***what i thought as a problem***/
ref.Test7(str);
System.out.println("Hi");
}
public void Test7(String str){
System.out.println(str);
}
public static void main(String[] args){
Test7 t = new Test7();
Test7 t7 = new Test7(t);
}
}



/**************question***********/
the output i get is Hai Hi
but according to what i understand it should be a compiler error because there is a constructer which takes two arguments. but there are none passed from main*********/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: wrong output?
 
Similar Threads
Please Explain
what is the correct answer of the following code
Objects- references
wrong output?
Objects by value/reference