Here is the code for the display Value method, shown earlier in this chapter: public static void
Question:
Here is the code for the display Value method, shown earlier in this chapter:
public static void displayValue(int num)
{
System.out.println("The value is " + num);
}
For each of the following code segments, indicate whether it will successfully compile or cause an error:
a. DisplayValue(100);
b. DisplayValue(6.0);
c. Short s = 5; displayValue(s);
d. Long num = 1; displayValue(num);
e. DisplayValue(6.2f);
f. DisplayValue((int) 7.5);
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Question Posted: