Results 1 to 3 of 3

Thread: input

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    Delaware
    Posts
    34

    input

    How do you get input from a user in Java like you can in C++ with "cin >> var;"?
    Tolkien is the greatest writer ever.

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Code:
    // you can either use the arguements passed in
    // on the command line
     class X{
     public static void main(String[] args){
      for(int i = 0; i < args.length; ++i){
      System.out.println(args[i]);
      }
     }
    }
    or by using System.in

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    Delaware
    Posts
    34
    Oh.. thanx!
    Tolkien is the greatest writer ever.

Posting Permissions

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



Click Here to Expand Forum to Full Width