It's not a secret anymore!
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
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "wrong output? " Watch "wrong output? " New topic

wrong output?

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***/
public void Test7(String str){
public static void main(String[] args){
Test7 t = new Test7();
Test7 t7 = new Test7(t);

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:
subject: wrong output?
It's not a secret anymore!