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");}
}
}
Can not find symbol num=MyInput.readInt();
Page 1 of 110 Replies - 309 Views - Last Post: 15 July 2012 - 02:20 PM
Replies To: Can not find symbol num=MyInput.readInt();
#2
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
#3
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.
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.
#4
Re: Can not find symbol num=MyInput.readInt();
Posted 15 July 2012 - 05:50 AM
atunio, 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");}
}
}
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");}
}
}
#5
Re: Can not find symbol num=MyInput.readInt();
Posted 15 July 2012 - 05:59 AM
#6
Re: Can not find symbol num=MyInput.readInt();
Posted 15 July 2012 - 06:08 AM
#7
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.
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.
#8
Re: Can not find symbol num=MyInput.readInt();
Posted 15 July 2012 - 06:43 AM
GregBrannon, 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.
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.
#9
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
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
#10
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
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
#11
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?
If you cannot answer these questions, then consider using the java.util.Scanner class for your needs.
- 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.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote







|