Question: In java 1.order the following from highest order 1 of precedence to lowest 5. assignment = parentheses () addition +, subtraction - multiplication *, division
In java
1.order the following from highest order 1 of precedence to lowest 5.
assignment =
parentheses ()
addition +, subtraction -
multiplication *, division
comparison ==,!=,<,<=,>,>=
2.Which of the following correctly declares and initializes an instance of the class String (multiple answers are correct):
a)String s = Java is good;
b) String s;
c) String s = Java is good;
d) String s = new.String(Java is good);
e) String s = Java + is + good;
f)String s = new String(Java is good);
3.Which of the following is a Java statement that assigns a previously declared boolean named myBool to true if the int myInt is greater than 8 and less than or equal to 34. Assume both variables are previously declared.
a)if (34 <= myInt < 8) myBool = true;
b)if (8 < myInt <= 34) myBool = true;
c) if (myInt > 8 && myInt <= 34) myBool = true;
d)myBool = (myInt > 8 || myInt <= 34);
3.Write a Java statement that declares and creates an object input of the Scanner class and sets it to read from the keyboard. Start the declaration in the first column. Include whitespace only as necessary.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
