This discussion is archived
1 Reply Latest reply: Jan 13, 2013 1:01 AM by PhHein RSS

Object Oriented Java Programming Help

984513 Newbie
Currently Being Moderated
Hello all, need some help with this hw question:

So I basically have this player class and I need to name a method that will return a hypothetical player score. The method has no parameters and returns the score as an int. Doesn't need any arguments.

I need to write code to create a player object, then call the method, and print the value returned.

I'm new to this but I was thinking:

public static getScore() {

System.out.println(something);
}

I don't really understand what a player object is, how/where I'm... I don't know. I'm just sort of confused. Again, I'm new to this. Could someone explain what the problem might be looking for and what's going on in the code. Any help is really appreciated!
  • 1. Re: Object Oriented Java Programming Help
    PhHein Guru Moderator
    Currently Being Moderated
    981510 wrote:
    Hello all, need some help with this hw question:

    So I basically have this player class and I need to name a method that will return a hypothetical player score. The method has no parameters and returns the score as an int. Doesn't need any arguments.

    I need to write code to create a player object, then call the method, and print the value returned.

    I'm new to this but I was thinking:

    public static getScore() {

    System.out.println(something);
    }

    I don't really understand what a player object is, how/where I'm... I don't know. I'm just sort of confused. Again, I'm new to this. Could someone explain what the problem might be looking for and what's going on in the code. Any help is really appreciated!
    You should ask the person who gave you that task. Look at the tutorials how methods work: http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

    Honestly, you should shut down the PC for a while and go back to the books to learn some basics.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points