Results 1 to 12 of 12
- 05-18-2010, 01:07 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
able to compile but unable to run. can any one tell me wats the mistake?
class VolcanoRobot5 {
String status;
int speed;
float temperature;
VolcanoRobot5(String inStatus, int inSpeed, float inTemperature) {
status = inStatus;
speed = inSpeed;
temperature = inTemperature;
}
void checkTemperature() {
if (temperature > 660) {
status = "returning home";
speed = 5;
}
}
void showAttributes() {
System.out.println("Status: " + status);
System.out.println("Speed: " + speed);
System.out.println("Temperature: " + temperature);
}
public static void main(String[] arguments) {
VolcanoRobot5 dante = new VolcanoRobot5("exploring", 2, 510);
dante.showAttributes();
System.out.println("Increasing speed to 3.");
dante.speed = 3;
dante.showAttributes();
System.out.println("Changing temperature to 670.");
dante.temperature = 670;
dante.showAttributes();
System.out.println("Checking the temperature.");
dante.checkTemperature();
dante.showAttributes();
}
}
- 05-18-2010, 01:14 PM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
Not able to runs means?? Whats the issue?? And please code tags to show your code.
Swastik
- 05-18-2010, 01:27 PM #3
code is ok and runnable right.Any path related exceptions u are getting?
Ramya:cool:
- 05-18-2010, 01:34 PM #4
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
when i try to run in cmd prompt, it says
exception in thread main java.lang.noclassdeffound
- 05-18-2010, 01:36 PM #5
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
What exactely are you typing into cmd? If you're typing in:
just omit .class.Java Code:java VolcanoRobot5.class
Ever seen a dog chase its tail? Now that's an infinite loop.
- 05-18-2010, 01:37 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Post the exact command that you are typing and the exact exception that you get.
- 05-18-2010, 01:43 PM #7
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
to compile javac volcanorobot5.java
to run java volcanorobot5.java
- 05-18-2010, 01:44 PM #8
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
Java is case sensitive. And when you run a java app, just type in the class name that has the main method, without any extensions.
Ever seen a dog chase its tail? Now that's an infinite loop.
- 05-18-2010, 01:46 PM #9
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
should be java VolcanoRobot5
Swastik
- 05-18-2010, 01:48 PM #10
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
oh thanq very much, i was using the extension, now its fine, thanq moonchile. bye.
- 05-18-2010, 01:48 PM #11
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
s i got it swastik
- 05-18-2010, 01:49 PM #12
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
Similar Threads
-
org.apache.jasper.JasperException: Unable to compile class for JSP:
By benperks in forum New To JavaReplies: 5Last Post: 11-20-2011, 09:22 PM -
org.apache.jasper.JasperException: Unable to compile class for JSP
By satya kishore in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 04-13-2010, 02:40 PM -
Wats up, Java people
By littlebrat in forum IntroductionsReplies: 0Last Post: 02-12-2009, 05:48 PM -
JasperException: Unable to compile
By Aerinai in forum Java ServletReplies: 0Last Post: 06-17-2008, 06:16 PM -
Unable to compile
By gapper in forum New To JavaReplies: 2Last Post: 01-14-2008, 04:31 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks