what is wrong with my code. doesnt compile
public class CarSimulator
{
public static void main(String []args)
{
FuelGauge amountOfFuel = new FuelGauge(0);
Odometer currentMileage = new...
Type: Posts; User: acl2011
what is wrong with my code. doesnt compile
public class CarSimulator
{
public static void main(String []args)
{
FuelGauge amountOfFuel = new FuelGauge(0);
Odometer currentMileage = new...
could you show me an example of a loop. and im a beginner java programming so i wasnt aware i had a loop inside a loop. could you help me fix this problem so i have no compile errors.
here are my compile errors
----jGRASP exec: javac -g Coin.java
Coin.java:29: error: non-static method toss() cannot be referenced from a static context
Coin.toss();
^
Coin.java:30:...
here is my code
public class CarSimulator
{
public static void main(String []args)
{
FuelGauge amountOfFuel = new FuelGauge(0);
Odometer currentMileage = new Odometer(amountOfFuel);
...
here is my code that i have so far. im not sure how to fix the problem
import java.util.Random;
public class Coin
{
private int sideUp;
void Coin()
{
toss();
Write a class named Coin. The Coin class should have the following field:
· A String named sideUp. The sideUp field will hold either “heads” or “tails” indicating the side of the coin that is facing...