Hello,
The main problem with your code is that you need to make your "main" class public by changing:
"class Example_5_1_1" to "public class Example_5_1_1" and as stated in a previous response, the class names are case sensitive and I changed "class car_5_1_1" to "class Car_5_1_1". I was then able to compile it with no problems. I have attached the modified java file and named it in concordance with the main class, Example_5_1_1.java.
Here is the final java code for you to cut-n-paste as well if wanted:
----------------------------------------------------------------------------
class Car_5_1_1
{
String licensePlate; // e.g. "96 C 1"
double speed; // in mph
double maxSpeed; // in mph
}
public class Example_5_1_1
{
public static void main(String args[])
{
Car_5_1_1 c;
c = new Car_5_1_1() ;
}
}
Cheers,
Tom
trying to catch up on coursework form a manual but getting a problem when trying to compile the example file.
class car_5_1_1
{
String licensePlate; // e.g. "96 C 1"
double speed; // in mph
double maxSpeed; // in mph
}
class Example_5_1_1
{
public static void main(String args[])
{
Car_5_1_1 c;
c = new Car_5_1_1() ;
}
}
can compile the car file ok but i get 2 erros with the Example one.
Cannot resolve symbol and it points to C in Car on both lines.
have tried change around caps etc on both but to no avail.
Help is appreciated...