Advice:
Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spotting structures mistakes.
class test{
public static void main(String args[]){
b ref=new b();
ref.x=99;
ref.show();
}
}
class a{
int x=10;
}
class b extends a{
void show(){
a ref=new a();
System.out.println(super.x);
}
}
class test{
public static void main(String args[]){
b ref=new b();
ref.x=99;
ref.show();
}
}
class a{
int x=10;
}
class b extends a{
void show(){
a ref=new a();
System.out.println(super.x);
}
}
Professional programmer's editors have this feature and others ones such as parenthesis matching and syntax highlighting.
Notepad++ Home[
^]
ultraedit[
^]
-----
This code will not compile because you pasted the same code 2 times.
The debugger is a tool that allow you to execute your code line by line and to inspect all variables as the program pause.
The debugger is an incredible learning tool, but you_ have to give it a try.