Assignment Detail:- Part A: MCQ
Question 1- What is the value of x after following statement is executed, given that int a = 1, int b = 2, int c = 3 and ind d = 4????
boolean x = -c - a - b-<a||-d-c- < a;a- trueb- falsec- nulld- 0
Question 2- Given the code:int -- x = new int-3-;x-0- = -1;x-1-=7;Which one of the following statements is correct????a- In x-0-=-1, 0 is the value and -1 is the index of the array elementb- The length of the array x can be obtained from x-length and is 4c- Statement x-1- = 7; will successfully assign 7 at index 1d- None of the above
Question 3- Given the following variable declarations:int x = 18;int y = 28;
what will the following code segment print on the screen????boolean a = !--x < 15-||-y> 15--;boolean b = !-x < 15- && -y > 15-;System-out-println-"a = "+ a +", b = " + b-;a- a = true, b = trueb- a = true, b = falsec- a = false, b = trued- a = false, b = false
Most Recent Questions