Source code for TemperatureExample2.java:

public class TemperatureExample2
{
	public static void main(String args[])
	{
		// TemperatureExample2
		int temperature = 95;
		if (temperature > 90)
		{
			System.out.println("It's too hot!");
			System.out.println("I want to go home!");
		}
		System.out.println("Have a nice day.");
	}
}

Output from TemperatureExample2.java:

It's too hot! I want to go home! Have a nice day.

--- Output Ends ---

NOTE:

You are reading previously generated output. You are not currently running the TemperatureExample2 application at the momement. You need to compile and run the source code first.

To run this program:


Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR