30 solutions available
Question 1(i)Consider the following code snippetif (c > d) x = c; else x = d;Choose the correct option if the code mentioned above is...
Question 1(ii)Which clause is optional in the switch statement?defaultcaseswitchNone of these
Question 1(iii)Errors occur in a program when :Syntax of the programming language is not followedthe program does not run properly or does not...
Question 1(iv)Object that share the same attributes and behaviour are grouped together into a/aninterfaceinstancealiasclass
Question 1(v)The statement (1 > 0) || (1 < 0) evaluates to01falsetrue
Question 1(vi)The parameters that are passed to the method when it is invoked are calledformal parametersactual parametersinformal parametersvoid...
Question 1(vii)Give the output of Math.sqrt(x); when x = 9.0.33.03.00All of these
Question 1(viii)What will be the output of the following code?String a[] = {"MI", "Samsung", "Micromax", "One Plus"};...
Question 1(ix)Polymorphism is broadly used in implementing ...............inheritanceencapsulationabstractionliterals
Question 1(x)Give the output of the followingswitch (x) { case 'M' : System.out.print ("Microsoft Teams"); break; case 'G':...
Question 1(xi)Given array int Z[ ] = {15, 16, 17} ; it will occupy ............... bytes in memory.3122464
Question 1(xii)In ............... search, the algorithm uses the middle value of the array for the search operation.binarylinearbubbleselection
Question 1(xiii)A single dimensional array contains N elements. What will be the last subscript?NN - 1N - 2N + 1
Question 1(xiv)Identify the output of the following code :String P = "20", Q = "19"; int a = Integer.parseInt(P); int b = Integer.valueOf(Q);...
Question 1(xv)What will be the output of following code?String c = "Hello i love java"; boolean var; var = c.startsWith("hello");...
Question 1(xvi)A string function which removes the blank spaces provided in the prefix and suffix of a...
Question 1(xvii)Assertion (A) Identifier is a name given to a package, class, interface, method or variable.Reason (R) Identifier allows a programmer...
Question 1(xviii)Read the following text and choose the correct answer:The Java compiler breaks the line of code into text (words) is called Java...
Question 1(xix)Assertion (A) next() can read the input only till the space.Reason (R) next() only gets to the line break.Both Assertion (A) and...
Question 1(xx)It can have the same access specifiers used for variables and methods.MethodClassConstructorObject
Question 2(i)Write the values of c and d after execution of following code.int a = 1; int b = 2; int c; int d; c = ++b; d = a++; c++;
Question 2(ii)Observe the following code and write how many times will the loop execute?a = 5; b = 2; while(b != 0) { r = a % b; a = b;...
Question 2(iii)Write the values that will be assigned to x, y and t after executing the following code.String s1, s2, x, y; int t; s1 = "classxii";...
Question 2(iv)Write the values that will be stored in variables num and sum after execution of the following code.int sum = 0, num = -2; do { sum...
Question 2(v)The following code has some error(s). Rewrite the correct code and underlining all the corrections made.integer counter = 0; i = 10;...
Question 2(vi)Rewrite the following program segment using while instead of for loop.int f = 1, i; for(i = 1; i <= 5 ; i++) { f *= i;...
Question 2(vii)State the method that(a) converts a string to a primitive float data type.(b) determines if the specified character is an uppercase...
Question 2(viii)Write the Java statement for the following mathematical expression:a=0.02−3y3x+ya = \dfrac{0.02 - 3y^3}{x + y}a=x+y0.02−3y3
Question 2(ix)Give the output of the following expression, when a = 6.a += ++a + a++ + a-- + a-- + --a + ++a
Question 2(x)Predict the output of the following.(a) Math.pow(2.5, 2) + Math.ceil(5)(b) Math.round(2.9) + Math.log(1)