java puzzle aditya#1

India
February 20, 2007 2:06am CST
public class X { X() { System.out.println("welcome to the world of MYLOT"); } private int X; public static void main(String args[]) { X X=new X(); String X1="10"; System.out.println(X1); } } Wht is the output...whether it gives the compilation eror's or runtime error or anyother? All the best
3 responses
• India
1 Mar 07
welcome to the world of MYLOT 10 Above is the output for ur puzzle. right?
1 person likes this
• India
2 Mar 07
yeah...that's right...my good friend
@hell_123 (228)
• India
22 Feb 07
it gives a compilation error .
• India
23 Feb 07
No my friend ..check once
@raghwagh (1527)
• India
20 Feb 07
Hi friend this code will give a compilation error as we have not declare the return type for the method X.I think so that everything elase is correct.
• India
21 Feb 07
Ho.Sory My friend... Check Once whether X() is an method or an Constructor... And try again all the best