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 3 Years Ago by happygeek: fixed formatting

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

Edited 3 Years Ago by happygeek: fixed formatting

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

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.

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.

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

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

This article has been dead for over six months. Start a new discussion instead.