DoubleClassMethodEquals

DoubleClassMethodEquals - + ", num2 = " + num2);...

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

View Full Document Right Arrow Icon
//Program illustrating how the operator == and the //method equals works with Double objects. / public class DoubleClassMethodEquals { public static void main(String[] args) { Double num1, num2; //Line 1 num1 = 2567.58; //Line 2 num2 = 2567.58; //Line 3 n System.out.println("Line 4: num1 = " + num1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: + ", num2 = " + num2); //Line 4 System.out.println("Line 5: The value of " + "num1.equals(num2) is " + num1.equals(num2)); //Line 5 System.out.println("Line 6: The value of " + "num1 == num2 is " + (num1 == num2)); //Line 6 } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Ask a homework question - tutors are online