help with error

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 33
Reputation: snitch321 is an unknown quantity at this point 
Solved Threads: 1
snitch321 snitch321 is offline Offline
Light Poster

help with error

 
0
  #1
Jan 3rd, 2008
does anyone know how to fix the problem here;(it says 'Public void input(int)' that line has a problem?


/**
* Write a description of class randommizer here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class temperature
{
private int input;

/**
* create input and response for user
*/

public temperature()
{
// do nothing
}


Public void input(int)
{
if(0 < 20) {
system.out.printIn("wear some shorts and sandals")
}
else {
system.out.printIn("please insert only numbers,ranging from -40 to 75")
}
}


}
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 27
Reputation: kingvjack is an unknown quantity at this point 
Solved Threads: 0
kingvjack kingvjack is offline Offline
Light Poster

Re: help with error

 
0
  #2
Jan 3rd, 2008
Originally Posted by snitch321 View Post
does anyone know how to fix the problem here;(it says 'Public void input(int)' that line has a problem?


/**
* Write a description of class randommizer here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class temperature
{
private int input;

/**
* create input and response for user
*/

public temperature()
{
// do nothing
}


Public void input(int)
{
if(0 < 20) {
system.out.printIn("wear some shorts and sandals")
}
else {
system.out.printIn("please insert only numbers,ranging from -40 to 75")
}
}


}
I'm no profesional here but it looks like you may be missing a bit.... uh... what is this gonna do anyways?
Steve
FA LSI Logic
Wichita KS
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,415
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 256
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: help with error

 
0
  #3
Jan 3rd, 2008
is the keyword public spelled public or Public?
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 Quick reply to this message  
Join Date: Nov 2007
Posts: 33
Reputation: snitch321 is an unknown quantity at this point 
Solved Threads: 1
snitch321 snitch321 is offline Offline
Light Poster

Re: help with error

 
0
  #4
Jan 4th, 2008
that was indeed a mistake that i have now corrected, but yet it still says their is a problem with this line 'Public void input(int)' ?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,403
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: help with error

 
0
  #5
Jan 4th, 2008
Because it is case sensitive, public is a keyword, Public could be a class or anything really.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,479
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 514
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: help with error

 
0
  #6
Jan 4th, 2008
Originally Posted by snitch321 View Post
that was indeed a mistake that i have now corrected, but yet it still says their is a problem with this line 'Public void input(int)' ?
Method parameters have a type and a name. You have only specified a type.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 33
Reputation: snitch321 is an unknown quantity at this point 
Solved Threads: 1
snitch321 snitch321 is offline Offline
Light Poster

Re: help with error

 
0
  #7
Jan 4th, 2008
so, judging from my coding what would the name be?
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,479
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 514
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: help with error

 
0
  #8
Jan 4th, 2008
Anything you want it to be - it's just a variable name. You need to brush up a bit on basic Java syntax and structure a bit more if you expect to get anywhere at all with this.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 224
Reputation: bugmenot is an unknown quantity at this point 
Solved Threads: 31
bugmenot bugmenot is offline Offline
Posting Whiz in Training

Re: help with error

 
0
  #9
Jan 4th, 2008
usually the idea of arguments is that you would use them in your method, so you need to give it a name
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 33
Reputation: snitch321 is an unknown quantity at this point 
Solved Threads: 1
snitch321 snitch321 is offline Offline
Light Poster

Re: help with error

 
0
  #10
Jan 6th, 2008
lol well ive literally just staretd learnin basic java at uni, and we've been given a project,so time will tell.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC