Hi all,
the following is a question from
http://www.anilbachi.8m.com please tell me what is the solution!
Q].What is the result of compiling and running the following
class methodA(int i){
class test{
public void methodA(int i){
System.out.println(i);}
public int methodA(int i){
System.out.println(i+1);}
public static void main(String args[]){
test X=new test();
X.methodA(5);
}
}
}
a).The program compiles and prints 5
b).The program compiles and prints 6
c).the program gives a runtime exception because it doesnot find the method Test.methodA(int)
d).The program gives a compilation error because methodA is defined twice in class Test.
Thanks in advance

[This message has been edited by madhu kumar (edited February 06, 2001).]