Regarding Scanner Object -- Cannot Resolve the Symbol

Hi,
I am new to Java, as well as this Forum.
Today I tried with Scanner object. But it shows Error.
My Code:
import java.util.Scanner;
public class CourseGradeBookTest
*     public static void main(String args[])*
*          Scanner input=new Scanner(System.in);*
*          CourseGradeBook CGB=new CourseGradeBook();*
*          System.out.println("Course Grade Book");*
*          String NameofCourse=input.nextLine();*
*          System.out.println();*
*          CGB.displayMessage(NameofCourse);*
Errors:
CourseGradeBookTest.java:1: cannot resolve symbol
symbol  : class Scanner
location: package util
import java.util.Scanner;
*^*
CourseGradeBookTest.java:7: cannot resolve symbol
symbol  : class Scanner
location: class CourseGradeBookTest
Scanner input=new Scanner(System.in);
*^*
CourseGradeBookTest.java:7: cannot resolve symbol
symbol  : class Scanner
location: class CourseGradeBookTest
Scanner input=new Scanner(System.in);
*^*
*3 errors*
I went through the Previous Questions which were related to My Question. I checked with My Java Version..its java version "1.6.0_02"
Can You please help Me to get out of this problem.
Regards
Rajan.

hi
i think u didnt set path currectly.
u can set path in two ways.
1) By Using Environmen Varibles
2) By Creating .bat file.
for creating environmental variables
right click on MyCompueter->properties->Advanced->Environment Variables->
System vaibles.

Similar Messages

  • Cannot resolve the symbol while using use bean in jsp

    Hi,
              Jsp with weblogic version 4.5 were running fine. When running on
              weblogic server 6.1 I get an error while running jsp pages cannot resolve
              symbol
              probably due to
              <jsp:useBean id = "hmllinkbean1" class="com.accupac.html.htmllink.LinkRS"/>
              I have the bean classes in
              config/accudomain/applications/DefaultWebApp_myserver/Web-inf/classes/
              and jsp files in the directory
              config/accudomain/applications/DefaultWebApp_myserver/
              Any help will be appreciated.
              Thanks
              madhu
              

    Three possibilities:
              Is your directory name really "Web-inf"? That will not work. It needs to be "WEB-INF".
              In WEB-INF, do you have:
              classes/com/accupac/html/htmllink/LinkRS.class
              When you say "cannot resolve symbol", is it the LinkRS class that it can't resolve?

  • Problem : Cannot resolve the collation conflict between ...

    Hi
    I want select a column from another database base on my current field on current database.
    here is my query :
    select ms.ServiceID, ms.ServiceName, ms.CoefficientFixedService,
    (select Services_Name from MpAdmisson..IAServices_Table where Services_DepartmentID=24 and Services_Name=ms.ServiceName) as N'MpServiceName'
    from MedicalServices ms
    join MedicalCategories mc on ms.MedicalCategorizationID=mc.MedicalCategorizationID
    join Zones z on mc.ZoneID=z.ZoneID
    where z.ZoneID=24
    but I'm facing this error :
    Cannot resolve the collation conflict between "Persian_100_CI_AI" and "Arabic_CI_AS" in the equal to operation.
    Also i changed collation of "MpAdmisson" db to "Persian_100_CI_AI" and even restart msSqlServer service, but i'm facing the same error!
    where is my problem and how to solve it ?
    thanks in advance
    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    although you changed the collation of the database it does not mean that all the objects changed their collation too automatically.
    So far you are correct.
    The change is only done when you change the data within the objects, thus recreating the table and moving data in / out or touching each and every value with doing something on the values themselves (the following will not work UPDATE (..) SET ServiceName
    = ServiceName, the optimizer is smart enough too see that as a noop).
    However, this is flat wrong. This is the story: each character column in a database has a collation tied to it. When you change the collation of a database, you change 1) the collation of the columns in the system tables. 2) The default collation. To change
    the collation on the individual columns, you need to alter the column:
    ALTER TABLE IAServices_Table
    ALTER COLUMN Services_Name <current data type> COLLATE Persian_100_CI_AI [NOT] NULL
    Unfortunately, this only works if the column is not indexed and has no constraints tied to it. Any indexes have to be dropped and recreated after the ALTER statement. If the column is a key column and there are referencing foreign keys, they also have to
    be dropped and recreated. Thus, this is quite a far-reaching operation. And it may not stop there - with some amount of bad luck, constraints may fail with the new collation.
    For this reason, this workaround suggested by Jens, may be your only option in the short term:
    If you cannot do this currently, you can still do the following and collate on a per query basis:
    select ms.ServiceID, ms.ServiceName, ms.CoefficientFixedService,
    (select Services_Name from MpAdmisson..IAServices_Table where Services_DepartmentID=24 and Services_Name=ms.ServiceName COLLATE Persian_100_AS_CI) as N'MpServiceName'
    from MedicalServices ms
    And this part of Jens's post is correct. To note though is that use of the COLLATE clause voids any index on ServiceName. (Since this index is sorted according the rules of Arabic, and not the rules of Farsi.)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Cannot resovle the Symbol error in UDF - Java mapping - RFC Lookup ?

    Hi Friends ,
    We are working on Java mapping  -  UDF for RFC Lookup . It is giving the Cannot resolve Symbol for all imported archive java class files even if we give again all imported files in import section of UDF we are still getting the same cannot resolve error  .
    We are using SP 12 of XI 3.0 . What could be the reason ?
    Thanks.,
    V.Rangarajan

    Hi,
    Can you try to open imported archive in IR and check if the path(folder structure like com.abc.xyz.etc) for classes is same as in import statement in UDF.Since we had experienced the same problem.
    Thanks.
    Regards,
    Shweta

  • I corrupted the firefox profile file using profile manager and firefox thinks it is still running and asks me to close but there is no instance of it running...I have tried several re-installs but cannot resolve the problem....

    .........I have deleted the .ini file associated with the profile file and the profile file itself...have tried to locate the "lock" file but cannot find the file in the specified path on the support forum for this problem....I believe there is a file mounted in another directory somewhere that firefox is seeing....I would really like to be able to use firefox as the default browser on this new linux (ubuntu) install...it was working prior to my trying to import my profile from the windows partition.....

    See this. <br />
    https://support.mozilla.com/en-US/kb/Firefox+hangs#Hang_at_exit

  • My MacBook cannot resolve the alias when attempting to connect to LAN wired devices (WD Live Media Centre), and says operation can't be comp-leted because the original item can't be found.???

    I have 2 WD Live Media Centre devices hard-wired on my LAN. My MacBook can find these devices on the network, but when it tries to access the USB drive which is attached to the media centres, a message says the Mac it "resolving the alias to USB drive", but then says operation can't be completed because the roiginal item (USB Drive) can't be found. My PC, which is also hard-wired on the network, has no problem accessing these USB drives. Is there some adjustment I need to make?

    Well, try this (I was able to fix my with these steps):
    Go Utilities > Disk Utility
    Select your Startup Disk, e.g. Macintosh HD
    Then, under the First Aid Tab, click Verify Disk Permissions.
    If there are errors, then click repair Disk Permissions.
    After it is done, restart the computer and see if your problem is resolved.
    I hope this help.
    Zeke
    www.ZekeYuen.com/blog/

  • Cannot find the Symbol

    my problem is:cannot find symbol variable coefsAndDegs ; Line 54
    please help me
    import java.util.*;
    class Term {
         private int coefficient;
         private int degree;
         public Term(int coefficient, int degree) {
              this.coefficient = coefficient;
              this.degree = degree;
         public int getCoefficient() {
              return coefficient;
         public int getDegree() {
              return degree;
    public class Polynomial {
        private char polyVar;
        private ArrayList<Term> terms;
        public void Polynomial(char polyVar, int ... coefsAndDegs) {
             Scanner kb = new Scanner(System.in);
             String polies = kb.nextLine();
              polyVar = polies.charAt(0);
             if (polyVar < 'a' || polyVar > 'z') {
                  throw new IllegalArgumentException("Invalid polynomial variable.");
             } else {
                  this.polyVar = polyVar;
             // check that coefsAndDegs are provided in pairs..
             if (coefsAndDegs.length % 2 != 0) {
                  throw new IllegalArgumentException("Coefficients and Degrees must be provided in pairs.");
             } else {
                  terms = new ArrayList<Term>();
                  for (int i = 0; i < coefsAndDegs.length / 2; i++) {
                       Term term = new Term(coefsAndDegs[i * 2], coefsAndDegs[i * 2 + 1]);
                       terms.add(term);
        public void main(String[] args){
         Polynomial main = new Polynomial();
        Polynomial(polyVar, coefsAndDegs);          
    }

    bluez_exe wrote:
    my problem is:cannot find symbol variable coefsAndDegs ; Line 54And what line is that? These forums don't have line numbers, and most of us are waay too lazy to copy and paste your code into something that does.
    What do you expect this to do:
    public void main(String[] args){
         Polynomial main = new Polynomial();
         Polynomial(polyVar, coefsAndDegs);          
              }Or this:
    if (polyVar < ' || polyVar > 'z')

  • Error -50         I have contacted iTunes but cannot resolve the issue

    I have tried downloading four different songs but every time error message 50 pops up and I cannot get any song to download even after iTunes help. If you have resolved this issue please let me know how to solve the issue.

    Some other posts seem to indicate that the cause is related to voice memos.  You may want to try the remedy described in this document
    http://support.apple.com/kb/ts2830
    although it says it's for the 6th gen iPod nano.

  • Just updated my iTunes. Now I get an error message regarding runtime and cannot open the app. Help

    Can anyone help. I am trying to open my iTunes on my HP laptop and now can't

    Hi Keys1998,
    If you are having issues with iTunes after an attempted update, you may want to try the steps in the following articles:
    Apple Support: Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    Apple Support: Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Regards,
    - Brenden

  • Cannot resolve symbol Scanner

    Hi all,
    i am using the Scanner class, while compiling i got an error cannot resolve the symbol Scanner. i checked my j.dk version also and it's 1.6
    syntax:
    File file = new File(fileName);
    Scanner scanner = new Scanner(file);
    error:
    TextScanner.java:10: cannot resolve symbol
    symbol : class Scanner
    location: class TextScanner
    Scanner scanner = new Scanner(file);
    java version "1.6.0_01"
    Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing).
    any help is appreciated.

    i have already imported that class.
    C:\Testing\junk\src>javac -d ..\classes forums\java\sun\Test.java
    forums\java\sun\Test.java:14: cannot find symbol
    symbol  : class Scanner
    location: class forums.java.sun.Test
            Scanner tester = new Scanner(System.in);
            ^This is the error I got without the import statement. Notice that it is eeriely similar to the error you received.
    Adding the above import fixed my problem. Make sure you are saving the file before trying to compile it, and that you are not compiling an older version.
    ~Tim
    EDIT: well, that would do it also!

  • Error when compiling cannot resolve symbol

    I am kind of new to java please take a look into this code. I am getting this error cannot resolve the symbol.
    this is the first class I saved under folder called javapractice as t1. I don't get any error message when I compile this, but when I compile the second class I got the error message.It would be appreciated if someone can help. thanks
    package javapractice;
    public class t1{
    double a;
    double b;
    double c;
    t1(double ax){
    a = ax;
    b = 0;
    c = 0;
    this is the second class also I saved as t2 under javapractice folder. when I compile this class I got the error cannot resolve the name.
    package javapractice;
    public class t2 {
    public static void main(String args[]) {
    t1 d = new t1();
    d.a = 3;
    System.out.println(d.a);
    System.out.println(d.b);
    System.out.println(d.c);

    The problem ist1 d = new t1();You need to pass a double param. to the constructor of t1t1 d = new t1((double)10.0);

  • Cannot invoke the APIs defined in Servlet 2.4 after installing the TOMCAT5

    I have no idea why I still cannot invoke the API like request.getRemotePort() and response.setCharacterEncoding() API after I upgraded to TOMCAT 5.0.
    I have included the servlet-api.jar provided with the TOMCAT 5.0 in the class path, but the compiler still cannot resolve the symbols (the above APIs)...
    How can I do?

    i also encounter this problem, i add severlet2.4 that jar file, but still same wrong message, finally , i found cause, it is because if you also add compile path of j2ee 1.3, that is confliction, so get rid of j2ee 1.3 or download new version of j2ee that will ok

  • GetPort() returns "cannot resolve symbol" error ???

    Hi !
    The bugs database indicate that some errors were fixed with HttpConnection.getPort() and with URL.getPort().
    However when I tried to implement a DataSourceServer class , I get following error when compiling :
    DataSourceServer.java:41: cannot resolve a symbol
    symbol : method getPort()
    Stub code follows :
    package datasource;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    import java.util.*;
    import oracle.jdbc.pool.OracleDataSource;
    public class DataSourceServer
      static ResourceBundle bundle = null; 
      public static void main(String args[])
        bundle = ResourceBundle.getBundle("DataSource");
        try
          // create and store the parameters used to create the context object
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY, bundle.getString("datasource.factory"));
          env.put(Context.PROVIDER_URL, bundle.getString("datasource.url"));
          // create the context
          Context context = new InitialContext(env);
          // create an Oracle datasource object
          OracleDataSource dataSource = new OracleDataSource();
          ... more code ...
          dataSource.setPortNumber(getPort()); // ERROR occurs here ???
          parm = bundle.getString("datasource.databasename");
          dataSource.setDatabaseName(parm);
          catch (Exception exc) {exc.printStackTrace();}
    }THX

    Hi !
    Okay, but I am not using HttpConnection.
    I am using the getPort() method from the default java.lang.Object ?
    I have tried importing java.net.*; but nope, didn't compile properly either.
    ( long sigh )

  • Cannot resolve symbol-- data access problem

    hi, everyone, i am new to java... thx for helping me.
    i have two files
    1) dls.java
    2) SliderDemo.java
    in the dls.java i have the following coding:
    JPanel slider = new SliderDemo(this);
    slider.framesPerSecond(0);
    and in the SliderDemo.java i have following coding:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class SliderDemo extends JPanel implements ActionListener {
    //This label uses ImageIcon to show the doggy pictures.
    JLabel picture;
    dls mydls;
    JSlider framesPerSecond;
    int i;
    public SliderDemo(dls mydls) {
    this.mydls = mydls;
    framesPerSecond = new JSlider(JSlider.HORIZONTAL, -10, 10, 0);
    framesPerSecond.addChangeListener(new SliderListener());
    //Turn on labels at major tick marks.
    framesPerSecond.setMajorTickSpacing(10);
    framesPerSecond.setMinorTickSpacing(1);
    framesPerSecond.setPaintTicks(true);
    framesPerSecond.setPaintLabels(true);
    framesPerSecond.setBorder( BorderFactory.createEmptyBorder(0,0,10,0));
    .....etc
    when i compile the dls.java
    it told me cannot resolve symbol , framePerSecond...
    help!!!why i can't resolve the symbol?
    thx all experts.
    yours,
    Terry

    cannot resolve symbol , framePerSecondPerhaps because you declared a variable whose name is "framesPerSecond" and then you tried to use "framePerSecond" instead of that?

  • ToArray error: cannot resolve symbol

    Hi ther,
    I am getting errors on the line:
    newArray = (char[]) newArrayList.toArray(new char[newArrayList.size()]);
    I am getting the following error:
    vowelProcess.java:176: cannot resolve sybmol
    Symbol : method toArray (char[])
    Location : class java.util.ArrayList
    I cant see what I am doing wrong. I have also tried the following:
    newArray = newArrayList.toCharArray();
    But get a similar error. Here is the entire method:
    public static void getDistinctVowels(char[] vowelArray)
    String newArrayValues; //initialise the option entered by user
    List newArrayList = new ArrayList();
    char[] newArray;
    boolean aValue = false;
    boolean eValue = false;
    boolean iValue = false;
    boolean oValue = false;
    boolean uValue = false;
    for(int i=0; i < vowelArray.length; i++){
         if (vowelArray[i] == 'a')
              aValue = true;
         if (vowelArray[i] == 'e')
              eValue = true;
         if (vowelArray[i] == 'i')
              iValue = true;
         if (vowelArray[i] == 'o')
              oValue = true;
         if (vowelArray[i] == 'u')
              uValue = true;
         } // end of for
    if (aValue == true)
              newArrayList.add(new char['a']);
    if (eValue == true)
              newArrayList.add(new char['e']);
    if (iValue == true)
              newArrayList.add(new char['i']);
    if (oValue == true)
              newArrayList.add(new char['o']);
    if (uValue == true)
              newArrayList.add(new char['u']);
    if (newArrayList.size() > 0)
              newArray = (char[])newArrayList.toArray(new char[newArrayList.size()]);
         String contentsOfNewArray = "";
         for(int i=0; i < newArray.length; i++) {
              contentsOfNewArray = contentsOfNewArray + newArray;
         } // end of for
    System.out.print("The contents of the new array are: " + contentsOfNewArray);
         else
              System.out.print("No values were entered.");
    } //getDistinctVowels
    } //vowelProcess

    one more question on this:
    If I loop through this array and print out the contents, I do not get the character value (should be a,e,i or u) but some other interpretation: "[C@6b97fd" instead of "a"
    here is the code:
    char[][] newArray = (char[][]) newArrayList.toArray(new char[newArrayList.size()][1]);
    System.out.println("The contents of the new array are: ");
         for(int i=0; i < newArray.length; i++) {
              System.out.println("Test: " + (char[])newArray);
         } // end of for
    I have also tried:
    System.out.println("Test: " + newArray[i]);
    or
    System.out.println("Test: " + newArray[i][0]);
    or
    System.out.println("Test: " + newArray[i][1]);
    thanks again.

Maybe you are looking for

  • How Do You Get Your DVD's onto the iPod Video?

    Is there a way to transfer my movies onto the iPod video? Will I need to buy the Quick Time Pro and then convert the video to mp4? Will that even work? Anyone put their movies on the iPod and can share? Thanks. Patrice www.HollywoodCharityAuction.com

  • More about Data Load

    Hello All, I am learning Importing CSV file and I have different errors and warnings. I would like to know more about : Utilities>Data Load Any recommendations to read links, books or information about it. Thanks, NYorker

  • What is Adobe Photoshop LIghtroom 3?

    I'm just upgrading to PS Elements 10 and now along comes (in the package!) an ad and 30-day trial CD of Adobe Photoshop Lightroom 3.  What's this?  An add on to PS Elements?  Replaces Elements?  Thanks so much for our answers!  George

  • File extension for keychain

    I see that there is an import function under the file menu in keychain.  I was wondering what the extension needed to be to import into it.  I have been able to export my passwords from firefox into a .xml and .cvs format but neither of those seem to

  • Premiere Elements 2.0 Capture Question

    Hello, I am trying to capture some old VHS tapes onto my computer through my camcorder and into Elements 2.0. I have the setting on the camcorder set to AV --> DV and when I go to the capture mode in Elements, the video, sound, etc. appear fine (this