Problems with adding an additional Java class
Answered
I am new to Java & IntelliJ and have gone through JB IntelliJ tutorial in YT.
I managed to create & run the Hello World program. I created another class (TempConversion) under the same package for another exercise (see screen shots below). Unfortunately, the second class does not work. I could not understand the error message. Pls help


Please sign in to leave a comment.
In the second class, you are calling the commands inside class itself, however a function is required.
The correct example would be
public class TempConversion {public static void main(String[] args) {
int saturdayFarenheit;
saturdayFarenheit = 78;
double saturdayCelsius = (5.0/9) * (saturdayFarenheit -32);
System.out.println("WeekAverage");
System.out.println("Saturday: " + saturdayCelsius);
}
}