Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In java 1.order the following from highest order 1 of precedence to lowest 5. as

ID: 3745368 • Letter: I

Question

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.

Explanation / Answer

1) 1. parentheses () 2. addition +, subtraction - 3. multiplication *, division 4. comparison ==,!=,= 5. assignment = 2) String s = “Java is good”; 3) if (myInt > 8 && myInt
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote