Search:

Type: Posts; User: acl2011

Search: Search took 0.10 seconds.

  1. Thread: Coin

    by acl2011
    Replies
    4
    Views
    2,826

    Re: Coin

    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:...
  2. Thread: Coin

    by acl2011
    Replies
    4
    Views
    2,826

    Re: Coin

    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();
  3. Thread: Coin

    by acl2011
    Replies
    4
    Views
    2,826

    Coin

    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...
Results 1 to 3 of 3