pls do help: random declaration error...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ana10192000
    New Member
    • Jun 2007
    • 9

    #1

    pls do help: random declaration error...

    import java.util.Rando m;
    public class random_game {
    public static void main (String args[]) {

    int ctr,guess;
    Random r = new Random();
    System.int.prin tln(r.input.int (100));
    int n = r.nextinput(100 );

    System.out.prin t("Enter guess number: ");
    guess = input.nextInt() ;
    guys, what's the problem with this code?i'm new in java programming, pls. help, error says:

    <identifier expected>
    System.int.prin tln(r.input.int (100));

    and not a statement
    System.int.prin tln(r.input.int (100));

    pls help...thanks so much
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    I don't think System.int is a proper class/object, and I don't think the Random class has a member named input. Maybe you should take a look at the System.out and Random specifications, and try to find what you want from there...these method names look made up.

    Comment

    • ana10192000
      New Member
      • Jun 2007
      • 9

      #3
      i already did that... same error... :(
      pls help...

      Comment

      • madhoriya22
        Contributor
        • Jul 2007
        • 251

        #4
        Originally posted by ana10192000
        i already did that... same error... :(
        pls help...
        Hi,
        I think u should read a bit more about java or atleast http://java.sun.com/j2se/1.4.2/docs/...il/Random.html Random class api.

        Comment

        Working...