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 +
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);
Step by Step Solution
3.37 Rating (163 Votes )
There are 3 Steps involved in it
Solution a DisplayValue100 ... View full answer
Get step-by-step solutions from verified subject matter experts
