RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 630 | Replies: 7 | Thread Tools  Display Modes
Reply
Join Date: Oct 2007
Posts: 2
Reputation: ColicabSyke is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ColicabSyke ColicabSyke is offline Offline
Newbie Poster

Help I can't understand what's wrong

  #1  
Nov 12th, 2007
I'm working on a program for school and the code I have so far is:
 
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,873
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 14
Solved Threads: 344
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: I can't understand what's wrong

  #2  
Nov 12th, 2007
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
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,749
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 19
Solved Threads: 200
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: I can't understand what's wrong

  #3  
Nov 12th, 2007
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Join Date: Feb 2006
Posts: 1,594
Reputation: masijade is a name known to all masijade is a name known to all masijade is a name known to all masijade is a name known to all masijade is a name known to all masijade is a name known to all 
Rep Power: 11
Solved Threads: 147
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: I can't understand what's wrong

  #4  
Nov 12th, 2007
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
Reply With Quote  
Join Date: Dec 2006
Posts: 10
Reputation: sach_ak47 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sach_ak47 sach_ak47 is offline Offline
Newbie Poster

Solution Re: I can't understand what's wrong

  #5  
Nov 14th, 2007
What is change????????
your Change class must be in same class Assign6 or if u have define in other class then use package to import that class
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,873
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 14
Solved Threads: 344
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: I can't understand what's wrong

  #6  
Nov 14th, 2007
Originally Posted by sach_ak47 View Post
What is change????????
your Change class must be in same class Assign6 or if u have define in other class then use package to import that class

Not that you are 4th person to mention, why bother to read previous posts hmm, waste of time isn't 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
Reply With Quote  
Join Date: Dec 2006
Posts: 10
Reputation: sach_ak47 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sach_ak47 sach_ak47 is offline Offline
Newbie Poster

Re: I can't understand what's wrong

  #7  
Nov 14th, 2007
Bull shit man if u got idea then set to flag as solved .........
You are westing ur time and my time also
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,749
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 19
Solved Threads: 200
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: I can't understand what's wrong

  #8  
Nov 15th, 2007
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:15 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC