Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    11
    Views
    1,606

    Re: Programm does not start. Help Please!

    The code should use the reference to the instance of the class: Schiff
    not the name of the class: Spielsystem



    theReferenceToTheClass.theMethod()


    BTW variable names should start with...
  2. Replies
    11
    Views
    1,606

    Re: Programm does not start. Help Please!

    If you have a reference to the class that the method is in, you can now call that method like this:

    theReferenceToTheClass.theMethod()
  3. Replies
    11
    Views
    1,606

    Re: Programm does not start. Help Please!

    What data are you asking about?

    Have you fixed the error:



    See this for more info on static methods:
    http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html
  4. Replies
    11
    Views
    1,606

    Re: Programm does not start. Help Please!

    What class is ende() in? Does the code create an instance of that class (by using the new statement)?

    You should look at the tutorial to see how to use methods:
    Defining Methods (The Java™...
  5. Replies
    11
    Views
    1,606

    Re: Programm does not start. Help Please!

    The non-static method ende() requires an instance of the class to reference it.
    referenceToClassObject.theMethod();

    Just like you did on this line:

    cpuship.spielzug();
  6. Replies
    11
    Views
    1,606

    Re: Programm does not start. Help Please!

    Please explain. If you get error messages, copy the full text of the error messages and paste it here.

    Please edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting...
Results 1 to 6 of 6