• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please Help

 
deepa philu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am facing the following problem while ecxecuting a program, when I try to change the values of the variables. Kindly help.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Deepa_Hodlur>cd..

C:\Documents and Settings>d:

D:\>cd deepa

D:\Deepa>cd javatest
The system cannot find the path specified.

D:\Deepa>cd prog

D:\Deepa\Prog>java prog1
hello world

D:\Deepa\Prog>javac Comparing.java
Comparing.java:1: 'class' or 'interface' expected
Class Comparing
^
1 error

D:\Deepa\Prog>javac Comparing.java
Comparing.java:10: ')' expected
System.out.println(A is equal to B)
^
Comparing.java:11: ';' expected
}
^
Comparing.java:14: ')' expected
System.out.println(A is lesser than B)
^
Comparing.java:15: ';' expected
}
^
Comparing.java:19: ')' expected
System.out.println(A is greater than b)
^
Comparing.java:20: ';' expected
}
^
6 errors

D:\Deepa\Prog>javac Comparing.java
Comparing.java:10: ')' expected
System.out.println(A is equal to B);
^
Comparing.java:14: ')' expected
System.out.println(A is lesser than B);
^
Comparing.java:19: ')' expected
System.out.println(A is greater than b);
^
3 errors

D:\Deepa\Prog>javac Comparing.java

D:\Deepa\Prog>java Comparing
A is lesser than B

D:\Deepa\Prog>java Comparing
A is lesser than B

D:\Deepa\Prog>javac Comparing.java

D:\Deepa\Prog>java Comparing.java
Exception in thread "main" java.lang.NoClassDefFoundError: Comparing/java

What does the above error mean? Has it got something to do with the classpath? Can anyone help me?

Thanks
Deepa
 
Henry Wong
author
Marshal
Pie
Posts: 21423
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D:\Deepa\Prog>java Comparing.java
Exception in thread "main" java.lang.NoClassDefFoundError: Comparing/java


Try.... "java Comparing" instead of "java Comparing.java".

Henry
 
Henry Wong
author
Marshal
Pie
Posts: 21423
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D:\Deepa\Prog>java Comparing.java
Exception in thread "main" java.lang.NoClassDefFoundError: Comparing/java


Try.... "java Comparing" instead of "java Comparing.java".

Henry
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D:\Deepa\Prog>javac Comparing.java
Comparing.java:1: 'class' or 'interface' expected
Class Comparing
^
1 error

Java is case-sensitive. The keyword is class with a lower-case c, but you wrote Class with an upper-case C.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic