Please support our Java advertiser: Lunarpages Java Web Hosting
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I'm working on a program for school and the code I have so far is:
I don't notice anything wrong with the code but the error message I get is:
C:\Java>javac Assign6.java
Assign6.java:5: cannot find symbol
symbol : class Change
location: class Assign6
Change aSmall = new Change(bill);
^
Assign6.java:5: cannot find symbol
symbol : class Change
location: class Assign6
Change aSmall = new Change(bill);
I can't figure out what the program does not like I seem to have problems like this in some of my other programs where the compiler doesn't recognize reserved words such as " iquote()" Could the problem be the compiler can't find the reserved words much like you have to set the PATH variable? This might all be a stupid question but I'm not all that familiar with Java in the first place.
public class Assign6{
public static void main(String[] args){
int bill = (int) (Double.parseDouble(args[0])*100);
Change aSmall = new Change(bill);
System.out.println("# of Fives: " + aSmall.numOfCoins(500) );
System.out.println("# of Ones: " + aSmall.numOfCoins(100) );
System.out.println("# of Q: " + aSmall.numOfCoins(25) );
System.out.println("# of D: " + aSmall.numOfCoins(10) );
System.out.println("# of N: " + aSmall.numOfCoins(5) );
System.out.println("# of P: " + aSmall.numOfCoins(1) );
}
}I don't notice anything wrong with the code but the error message I get is:
C:\Java>javac Assign6.java
Assign6.java:5: cannot find symbol
symbol : class Change
location: class Assign6
Change aSmall = new Change(bill);
^
Assign6.java:5: cannot find symbol
symbol : class Change
location: class Assign6
Change aSmall = new Change(bill);
I can't figure out what the program does not like I seem to have problems like this in some of my other programs where the compiler doesn't recognize reserved words such as " iquote()" Could the problem be the compiler can't find the reserved words much like you have to set the PATH variable? This might all be a stupid question but I'm not all that familiar with Java in the first place.
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,873
Reputation:
Rep Power: 14
Solved Threads: 344
This deffenetly is not compiler error. It is the code writter/author error! You telling to your program to use a class called Change but is it implemented somewhere? I do not see it
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
Publilius Syrus
(~100 BC)
LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,749
Reputation:
Rep Power: 19
Solved Threads: 200
what's "Change"? That's not a class from the standard libraries, so you need to have it somewhere yourself.
And that's what the compiler is telling you, that you're referring to something it doesn't know about.
And that's what the compiler is telling you, that you're referring to something it doesn't know about.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
If that's your complete program, then you've forgotten to import the class Change, and yes, that class must be found on your classpath, see http://java.sun.com/docs/books/tutor...ted/index.html
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,873
Reputation:
Rep Power: 14
Solved Threads: 344
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
Publilius Syrus
(~100 BC)
LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,749
Reputation:
Rep Power: 19
Solved Threads: 200
you still don't understand? You're only the fourth person presenting the exact same answer. Neither OP nor you seems interested in reading responses.
And you've quite a bad atttitude, cool it down a bit.
And you've quite a bad atttitude, cool it down a bit.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
Other Threads in the Java Forum
- Please review, what am I doing wrong here? (Website Reviews)
- cannot understand why i am getting the wrong results. (Oracle)
- 'svchost' problem, what's wrong with it? (Viruses, Spyware and other Nasties)
- What's wrong with this webpage? (Site Layout and Usability)
- No sound in Windows Media Player (Windows 9x / Me)
- Think I have big problems with spyware (Viruses, Spyware and other Nasties)
- no error message but showing project not compiled (C++)
- Break statments confuse me, need some help (C++)
- Simple Programming Errors (Computer Science)
Other Threads in the Java Forum
- Previous Thread: Base Conversion
- Next Thread: Making a program that counts the # of characters
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode