10 Replies - 727 Views - Last Post: 15 July 2012 - 02:20 PM Rate Topic: -----

#1 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 04:47 AM

Help me to resolve this error
When i compile bellow program in JDK1.7 there is error: Can not find symbol num=MyInput.readInt();
i don't understand what is this and why i am getting this error help me i am waiting for your response

This is my Program:

public class Circle
{
public static void main(String[] args)throws Exception
{
int num;
System.out.println("Enter a number between 10 and 20:-");
num=MyInput.readInt();

if(num>10 && num<20)
{System.out.println("You have entered a valid number");}

else
{System.out.println("The number you entered is not a valid number");}

}
}

Is This A Good Question/Topic? 0
  • +

Replies To: Can not find symbol num=MyInput.readInt();

#2 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2773
  • View blog
  • Posts: 11,717
  • Joined: 20-September 08

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 05:22 AM

There's no class called 'MyInput' in your app, yet you refer to it. That's your problem
Was This Post Helpful? 2
  • +
  • -

#3 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2203
  • View blog
  • Posts: 5,235
  • Joined: 10-September 10

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 05:23 AM

Please post your code in code tags. You can learn how to do this as well as other interesting forum courtesies and suggestions about how to make good posts at the "New to Dream.In.Code - FAQ" that I suggest you read.

The error, "Cannot find symbol" means you've given the compiler something it doesn't understand or recognize. In this case, the compiler has no idea what "MyInput" is. Since MyInput takes a readInt() method, I suspect it is a custom input class, like Java's Scanner. You should check to see if you're supposed to be importing a specific library to use the MyInput class, or learn how to use Java's Scanner class.
Was This Post Helpful? 0
  • +
  • -

#4 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 05:50 AM

View Postatunio, on 15 July 2012 - 04:47 AM, said:

Help me to resolve this error
When i compile bellow program in JDK1.7 there is error: Can not find symbol num=MyInput.readInt();
i don't understand what is this and why i am getting this error help me i am waiting for your response

This is my Program:

public class Circle
{
public static void main(String[] args)throws Exception
{
int num;
System.out.println("Enter a number between 10 and 20:-");
num=MyInput.readInt();

if(num>10 && num<20)
{System.out.println("You have entered a valid number");}

else
{System.out.println("The number you entered is not a valid number");}

}
}

Was This Post Helpful? 0
  • +
  • -

#5 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 05:59 AM

View Postg00se, on 15 July 2012 - 05:22 AM, said:

There's no class called 'MyInput' in your app, yet you refer to it. That's your problem


what is mean by class MyInpu in my program can you please rewrite my program with correct mistake
that same programm with correction
Was This Post Helpful? 0
  • +
  • -

#6 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 06:08 AM

View Postatunio, on 15 July 2012 - 05:59 AM, said:

View Postg00se, on 15 July 2012 - 05:22 AM, said:

There's no class called 'MyInput' in your app, yet you refer to it. That's your problem


what is mean by class MyInpu in my program can you please rewrite my program.
Write same programm with correction

Was This Post Helpful? 0
  • +
  • -

#7 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2203
  • View blog
  • Posts: 5,235
  • Joined: 10-September 10

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 06:27 AM

We explained to you what it meant and gave you possible resolution paths. If you can't pursue those, especially if you're unable to understand 'class MyInput', then you should ask your instructor for help.

No, we can't rewrite/correct your code for you. What would you learn from that? What would you do for the next exercise or test?

Stop bumping your thread, and get to work.
Was This Post Helpful? 0
  • +
  • -

#8 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 06:43 AM

View PostGregBrannon, on 15 July 2012 - 06:27 AM, said:

We explained to you what it meant and gave you possible resolution paths. If you can't pursue those, especially if you're unable to understand 'class MyInput', then you should ask your instructor for help.

No, we can't rewrite/correct your code for you. What would you learn from that? What would you do for the next exercise or test?

Stop bumping your thread, and get to work.

Was This Post Helpful? 0
  • +
  • -

#9 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 06:52 AM

i am new please guide my how can i take input. lot of time ago i had learn java now i am starting learn again i have learn take input from user by this, there is a statement to write input from user

first we initialize variable like :
int num;

that we learn to take input like this:

num=MyInput.readInt();

all work in My class:

class Circle

what is wrong there i don't understand what is my mistake to take input from user i have search from google but still i could not find please help me
Was This Post Helpful? 0
  • +
  • -

#10 atunio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 15-July 12

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 07:59 AM

i am new please guide my how can i take input. lot of time ago i had learn java now i am starting learn again i have learn take input from user by this, there is a statement to write input from user

first we initialize variable like :
int num;

that we learn to take input like this:

num=MyInput.readInt();

all work in My class:

class Circle

what is wrong there i don't understand what is my mistake to take input from user i have search from google but still i could not find please help me
Was This Post Helpful? 0
  • +
  • -

#11 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10644
  • View blog
  • Posts: 39,515
  • Joined: 27-December 08

Re: Can not find symbol num=MyInput.readInt();

Posted 15 July 2012 - 02:20 PM

Please don't needlessly bump your thread. g00se answered your question. Can you answer the following questions?
  • What is MyInput?
  • Can you post the MyInput class? If so, please post it.


If you cannot answer these questions, then consider using the java.util.Scanner class for your needs.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1