Results 1 to 7 of 7
  1. #1
    Shyam Singh is offline Member
    Join Date
    Jun 2008
    Posts
    48
    Rep Power
    0

    Default Wats the problem here ? anythig wrong with IDE

    import java.io.*;

    import java.util.Scanner; // showing compile time error here

    public class scanTest {

    public static void main(String []args) {

    Scanner s=new Scanner(System.in); // showing compile time error here
    String param=s.next();

    System.out.println("the param1"+param);
    int value=s.nextInt();
    System.out.println("second param2"+value);
    s.close();

    }
    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,412
    Rep Power
    25

    Default

    // showing compile time error here
    What is the error?
    You'll save us all a lot of time if you give ALL the information you have in the beginning.
    Copy and paste the full text of the messages here.

  3. #3
    sahhhm is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default

    What version of Java are you using?

  4. #4
    Shyam Singh is offline Member
    Join Date
    Jun 2008
    Posts
    48
    Rep Power
    0

    Default reply to Norm

    scanTest.java [3:1] cannot resolve symbol
    symbol : class Scanner
    location: package util
    import java.util.Scanner; // showing compile time error here
    ^
    scanTest.java [9:1] cannot resolve symbol
    symbol : class Scanner
    location: class scanTest
    Scanner s=new Scanner(System.in); // showing compile time error here
    ^
    scanTest.java [9:1] cannot resolve symbol
    symbol : class Scanner
    location: class scanTest
    Scanner s=new Scanner(System.in); // showing compile time error here
    ^
    3 errors
    Errors compiling scanTest.

  5. #5
    Shyam Singh is offline Member
    Join Date
    Jun 2008
    Posts
    48
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    What is the error?
    You'll save us all a lot of time if you give ALL the information you have in the beginning.
    Copy and paste the full text of the messages here.
    scanTest.java [3:1] cannot resolve symbol
    symbol : class Scanner
    location: package util
    import java.util.Scanner; // showing compile time error here
    ^
    scanTest.java [9:1] cannot resolve symbol
    symbol : class Scanner
    location: class scanTest
    Scanner s=new Scanner(System.in); // showing compile time error here
    ^
    scanTest.java [9:1] cannot resolve symbol
    symbol : class Scanner
    location: class scanTest
    Scanner s=new Scanner(System.in); // showing compile time error here
    ^
    3 errors
    Errors compiling scanTest.

    I m using netbeans 3.5.1 & j2sdk 1.4.1

  6. #6
    Shyam Singh is offline Member
    Join Date
    Jun 2008
    Posts
    48
    Rep Power
    0

    Default

    Quote Originally Posted by sahhhm View Post
    What version of Java are you using?
    scanTest.java [3:1] cannot resolve symbol
    symbol : class Scanner
    location: package util
    import java.util.Scanner; // showing compile time error here
    ^
    scanTest.java [9:1] cannot resolve symbol
    symbol : class Scanner
    location: class scanTest
    Scanner s=new Scanner(System.in); // showing compile time error here
    ^
    scanTest.java [9:1] cannot resolve symbol
    symbol : class Scanner
    location: class scanTest
    Scanner s=new Scanner(System.in); // showing compile time error here
    ^
    3 errors
    Errors compiling scanTest.

    """""" I m using netbeans 3.5.1 & j2sdk 1.4.1 """"""""

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,412
    Rep Power
    25

    Default

    Read the API docs for Scanner. At the bottom of the first section is a line starting: Since: followed by the version of java that the class was added. Your JSK is too old.

Similar Threads

  1. What's wrong with my codes?
    By ayoood in forum New To Java
    Replies: 16
    Last Post: 09-01-2008, 03:57 AM
  2. Replies: 2
    Last Post: 07-11-2008, 09:41 AM
  3. wrong values
    By mark-mlt in forum New To Java
    Replies: 8
    Last Post: 04-25-2008, 11:11 AM
  4. I am Doing Something Wrong But Don't Know What?
    By BHCluster in forum New To Java
    Replies: 3
    Last Post: 04-16-2008, 01:16 PM
  5. What's wrong with this code?
    By Wizard wusa in forum New To Java
    Replies: 14
    Last Post: 01-22-2008, 11:55 PM

Posting Permissions

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