first of all i want to say that this post is completly not security related and i thought that this forum might matches it the best out of them all. Anyways, this sounds really stupid but i jhave written up a class in Java, now all i want to do is call it from main(). The problem is that i forgot how to do this and none of my lame text books or any tutorials on this site or sun.java.com tell me how to do this. Anyways, this is my code so far, it is a stupid program so dont tell me it is stupid cause i already know:
Code:
public class Main
{
public class Car
{
private int year;
private int size;
private int gear;
public void set(int y, int s, int g)
{
year=y;
size=s;
gear=g;
}
public void tell()
{
System.out.println("You car is " +size +" big and ");
System.out.print("was made in "+year +" and has ");
System.out.print(gears +" gears.");
}
}
public static void main(String[] args)
{
Car volvo = new Car;
volvo.set(1998,100,5)
volvo.tell();
}
}
the files name is Main. Anyways when i try to compile this program i get one error on the line that says . How do i make the stupid object volvo!!!????? God i hate this language...anyways any help would be very much appriciated! Thanks