0

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



}

Edited by happygeek: fixed formatting

6
Contributors
9
Replies
10
Views
9 Years
Discussion Span
Last Post by snitch321
0

I'm no profesional here but it looks like you may be missing a bit.... uh... what is this gonna do anyways?

Edited by happygeek: fixed formatting

0

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)' ?

0

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.

0

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.

0

usually the idea of arguments is that you would use them in your method, so you need to give it a name

0

lol well ive literally just staretd learnin basic java at uni, and we've been given a project,so time will tell.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.