• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Please Help

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic