Here is the code......
public class MyTest{
int x=30;
public static void main(
String args[]){
int x=20;
MyTest ta= new MyTest();
ta.method(x);
System.out.println("The x value is" +x);
}
void method(int y){
int x=y*y;
}
}
The correct answer is 20.Shouldn't it print 400?
Can somebody explain why?
Also when
int a=10;
float f=10;
How does a==f returns true
Val your input will be greatly appreciated........