{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

DoCompare

# DoCompare - System.out.println S firstBool =-3<=-10...

This preview shows page 1. Sign up to view the full content.

// File: DoCompare.java // Course: CSC 211 // Author: Amber Settle // Purpose: Demonstrate some basic integer comparisons / public class DoCompare { // Outputs the results of various integer comparisons / public static void main(String[] args) { boolean firstBool, secondBool; b firstBool = (0 == 0); System.out.println("Is 0 == 0? " + firstBool); secondBool = (5 == 0); System.out.println("Is 5 == 0? " + secondBool); System.out.println(); S firstBool = (1 != 1); System.out.println("Is 1 != 1? " + firstBool); secondBool = (1 != -2); System.out.println("Is 1 != -2? " + secondBool); System.out.println(); S firstBool = (5 < 12); System.out.println("Is 5 < 12? " + firstBool); secondBool = (0 < 0); System.out.println("Is 0 < 0? " + secondBool);
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println(); S firstBool = (-3 <= -10); System.out.println("Is -3 <= -10? " + firstBool); secondBool = (0 <= 0); System.out.println("Is 0 <= 0? " + secondBool); System.out.println(); S firstBool = (11 > 11); System.out.println("Is 11 > 11? " + firstBool); secondBool = (11 > -4); System.out.println("Is 11 > -4? " + secondBool); System.out.println(); S firstBool = (11 >= 11); System.out.println("Is 11 >= 11? " + firstBool); secondBool = (11 >= 103); System.out.println("Is 11 >= 103? " + secondBool); System.out.println(); S // What does a Boolean value look like when printed? boolean thirdBool = false; System.out.println(thirdBool); S } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online