Time correct answers out of20 questions. 35% percent spent on the testis 18 minu
ID: 3797256 • Letter: T
Question
Time correct answers out of20 questions. 35% percent spent on the testis 18 minutes 58seconds 1 Given Ix 2A 4, which of the following is true? 2 Which of the folowing operators are right-associatve. A, && D. (binary 4) 3 answer is correct true? Given Ix-21 which ofthe following is 4 In a switch statement, the default case must appear last among alcases. Otherwise, it would result in a complation error. A true B. false 5 What is the output ofthe folowing code (Ploase indent the stalement correcsy fist.) 9 and z System.out printhrx g and z T: A none C, K 9 and z 7. D. x 9 and y &Explanation / Answer
1) Answer: A
Explanation:- Given |x-2| <=4
|x-2|<=4 or x-2 >=-4
So answer will be |x-2|<=4 || x-2 >=-4
---------------------------------------------------------------------------
2) Answer: B
Explanation:-
Left -associative (meaning the operations are grouped from the left), right-associative (meaning the operations are grouped from the right)
-----------------------------------------------------------------------------------
3) Answer:- D
Explanation:- Given |x-2| >=4
|x-2|>=4 or x-2 <=-4
So answer will be |x-2|>=4 || x-2 <=-4
-------------------------------------------------------------------------------------------------
4) Anwser: B
Explanation:-
It is not necessary that default statement must appear at last.
----------------------------------------------------------------------------------
5) Answer: A
Explanation
Run following code, it will not print.
package chegg;
public class Demo {
public static void main(String[] args) {
int x=9;
int y=8;
int z=7;
if(x>9)
if(x>8)
System.out.println("x>9 and y> 8");
else
if(z>=7)
System.out.println("x<=9 and z>=7 ");
else
System.out.println("x<=9 and z<=7 ");
}
-------------------------------------------------------------
15) Answer: B
Explanation:-
Manth,random() function Return value will be
A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive) [0,1)
---------------------------------------------------------------------------------------------------------
For answer 6-14 please upload good quality of photo.
If you have any query, please feel free to ask.
Thanks a lot.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.