943,657 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 999
  • Java RSS
Jan 3rd, 2008
0

help with error

Expand 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")
}
}


}
Similar Threads
Reputation Points: 9
Solved Threads: 2
Junior Poster in Training
snitch321 is offline Offline
63 posts
since Nov 2007
Jan 3rd, 2008
0

Re: help with error

Click to Expand / Collapse  Quote originally posted by snitch321 ...
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?
Reputation Points: 13
Solved Threads: 0
Light Poster
kingvjack is offline Offline
28 posts
since Aug 2006
Jan 3rd, 2008
0

Re: help with error

is the keyword public spelled public or Public?
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Jan 4th, 2008
0

Re: help with error

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)' ?
Reputation Points: 9
Solved Threads: 2
Junior Poster in Training
snitch321 is offline Offline
63 posts
since Nov 2007
Jan 4th, 2008
0

Re: help with error

Because it is case sensitive, public is a keyword, Public could be a class or anything really.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Jan 4th, 2008
0

Re: help with error

Click to Expand / Collapse  Quote originally posted by snitch321 ...
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.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,756 posts
since May 2007
Jan 4th, 2008
0

Re: help with error

so, judging from my coding what would the name be?
Reputation Points: 9
Solved Threads: 2
Junior Poster in Training
snitch321 is offline Offline
63 posts
since Nov 2007
Jan 4th, 2008
0

Re: help with error

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.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,756 posts
since May 2007
Jan 4th, 2008
0

Re: help with error

usually the idea of arguments is that you would use them in your method, so you need to give it a name
Reputation Points: 53
Solved Threads: 33
Posting Whiz in Training
bugmenot is offline Offline
224 posts
since Nov 2006
Jan 6th, 2008
0

Re: help with error

lol well ive literally just staretd learnin basic java at uni, and we've been given a project,so time will tell.
Reputation Points: 9
Solved Threads: 2
Junior Poster in Training
snitch321 is offline Offline
63 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: moving objects at the same time?
Next Thread in Java Forum Timeline: Init buttons() help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC