Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

dhruv garg

Greenhorn
+ Follow
since Dec 24, 2011
dhruv likes ...
Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by dhruv garg

thank you for your advice. i didnt reboot my system after changing the path and JAVA_HOME variables. now every thing is working fine.
8 years ago
it is happening with every program....not with a particular program
8 years ago
i did what was told in the tutorial but still my program is not working
8 years ago
it is happening with every program.
if you want to see my code you can see but i think it will be of no use.there must be some problem with system...i dont know...

here is the code:-

class A
{
private int a;
A(int a)
{
this.a =a;
}
void show()
{
System.out.println("a="+a);
} // End of show()
}// End of class A
public class innertest
{
public static void main(String args[])
{

A a1 = new A(20){
public void show()
{
super.show();
System.out.println("Hello");
}
public void display()
{
System.out.println("Hi");
}
};
a1.show();
// a1.display();
}
}
8 years ago
file name should be same as main class only when the main class is public.
anyways i changed the file name too but its not working.
8 years ago
my program is able to pass the compilation test.but when i run the program its gives error

"C:\Users\DHRUV\My Documents\java>javac innerclass.java

C:\Users\DHRUV\My Documents\java>java innertest
Error: Could not find or load main class innertest

here the file name is innerclass.java and the main class name is innertest.

kindly help me out
8 years ago
my program is able to pass the compilation test.but when i run the program its gives error

"C:\Users\DHRUV\My Documents\java>javac innerclass.java

C:\Users\DHRUV\My Documents\java>java innertest
Error: Could not find or load main class innertest

here the file name is innerclass.java and the main class name is innertest.

kindly help me out
8 years ago