Hi
I would like to Ask a Question about compiling an OOP Java application.
Below is a Class Called ComputerGame.java which holds Game Details.
package OOP;
public class ComputerGame
{
private String Name;
private String Description;
private float Cost;
private boolean Released;
private final String Publisher = "TriWorld Studios";
public ComputerGame(String Name)
{
Name = this.Name;
}
public ComputerGame(String Name, float Cost)
{
Name = this.Name;
Cost = this.Cost;
}
public static void Buy()
{
System.out.println(" The Buy Method ");
}
public static void Play()
{
System.out.println(" The Play Method ");
}
public static void Store()
{
System.out.println(" The Store Method ");
}
public static void Sell()
{
System.out.println(" The Sell Method ");
}
public String GetName()
{
return Name;
}
public String GetDescription()
{
return Description;
}
public float GetCost()
{
return Cost;
}
public boolean GetReleased()
{
return Released;
}
public void SetName(String Name)
{
Name = this.Name;
}
public void SetDescription(String Description)
{
Description = this.Description;
}
public void SetCost(float Cost)
{
Cost = this.Cost;
}
public void SetReleased(boolean Released)
{
Released = this.Released;
}
}
Below is the Main Class which is supposed to create an Object of type Computer Game
package OOP;
public class ComputerGameMain
{
public static void main(String[] args)
{
ComputerGame FierceArmour = new ComputerGame("Fierce Armour", "A Strategy Game");
ComputerGame Tennis3D = new ComputerGame("Tennis 3D", "A Sports Game");
ComputerGame TwoDCarton = new ComputerGame("2DCarton", "An Arcafe Game");
FierceArmour.setCost(56.45);
FierceArmour.setReleased(true);
Tennis3D.setCost(76.34);
Tennis3D.setReleased(false);
TwoDCarton.setCost(23.99);
TwoDCarton.setReleased(true);
}
}
I am using a Text Editor to create this Application ( Geany ).
I Would like to know ho to link the CoumputerGame Class to the Main Class and how to compile these using javac or any other compiler.
Thank You,
Andrew Borg