Write the code to declare a constant MINUTES_PER_SECOND in a method. Initialize it to 60. |
final int MINUTES_PER_SECOND = 60; |
|
Write the code to declare a constant MINUTES_PER_SECOND out side any method. (That is, it can be used by any method in the class - or in a different class) Initialize it to 60. |
public static final int MINUTES_PER_SECOND = 60; |
|
| A process takes 2345.9 hours. Write a Java expression to determine the number of whole days needed. There will be a fractional part to the number of days, but we want only the number of whole days. |
(int)(2345.9 / 24) |
|
Given that x = 5 and y = 8, what is the value of this expression?
x + y / 2 |
9 |
|
| What is printed by this code segment? |
int counter = 7;
counter++;
System.out.println(counter);
3 |
|
| What is 7 % 2 |
1 |
|