Results 1 to 5 of 5

Thread: java starters

  1. #1
    MithunDhar is offline Member
    Join Date
    Mar 2009
    Posts
    7
    Rep Power
    0

    Default java starters

    I have question? can anyone help me out?

    Write a java program to create a Player class. Inherit the classes Cricket_Player, Football_player and Hockey_player from Player class?

    What are attributes and methods will I use?

  2. #2
    vijayabaskar is offline Member
    Join Date
    Apr 2009
    Posts
    37
    Rep Power
    0

    Default

    In Cricket_player class
    {
    String teamname;
    String palyername;
    int teamscore;
    int playerscore;
    int boundaries;
    viod team(String teamname);

    }

    class Football_player
    {
    String teamname;
    String palyername;
    int teamscore;
    int playerscore;
    int goal;
    viod team(String teamname);

    }

  3. #3
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    449
    Rep Power
    6

    Default

    Create a class abstract class player that contains some basic attributes of player such Name,Age,Location .

    create a class cricket player that extends player class and contain the attribute such Runs and wickets he scored.By getScore(),getWicket() you can retrive the value of score and wicket.


    Do the same thing for hockeyplayers...
    Mak
    (Living @ Virtual World)

  4. #4
    khalda is offline Member
    Join Date
    Apr 2009
    Posts
    1
    Rep Power
    0

    Default plz send answer very soon

    Quote Originally Posted by MithunDhar View Post
    I have question? can anyone help me out?

    Write a java program to create a Player class. Inherit the classes Cricket_Player, Football_player and Hockey_player from Player class?

    What are attributes and methods will I use?
    plz give me code

  5. #5
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default

    Nope... it doesn't work that way. The forum helps you with specific answers to specific questions or problems. The forum doesn't give out code or complete solutions upon request... this isn't "Code-R-Us". What have you tried? Show us the code you have tried.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •