30 solutions available
Question 1(i)What will be the output of the following code?int size = 2; if (size < 0) System.out.println("Small"); else if (size == 0)...
Question 1(ii)Which of the following statements involves a fall through?if-elsefor loopif-else-ifswitch
Question 1(iii)Which of the following statement is true for logical errors?The compiler does not detect these errors.There is no indication of error...
Question 1(iv)Object oriented programming mainly usestop down approachtop down and bottom up approachbottom up approachNone of the above
Question 1(v)In which technique are the values of actual parameters copied to the formal parameters?Call by referenceCall by valueCall by...
Question 1(vi)Which package would you import for the Scanner class?java.util.*;java.awt.*;java.io.*;java.lang.*;
Question 1(vii)Give the output of Math.abs(x); when x = -9.99.-9.999.990.99None of these
Question 1(viii)A/An ............... is an abstract description of a set of objects.abstractionencapsulationpolymorphismclass
Question 1(ix)This variable can be accessed by calling with the class name.InstanceLocalClassNone of these
Question 1(x)The main objective of passing arguments to functions ismessage passingparameter passingvariable passingargument passing
Question 1(xi)If int arr [] = {3, 5, 7, 9}; what is the value of arr.length?354Cannot be determined
Question 1(xii)A binary searchcan be used with sorted arrays only.can be used with unsorted arrays only.can be used with both sorted and unsorted...
Question 1(xiii)Corresponding wrapper class of float data type isFLOATfloatFloatFloating
Question 1(xiv)What will be the output of the following code?System.out.println("Lucknow".substring (0, 4));LucknowLucknLuckluck
Question 1(xv)This access specifier is the most open access level.PublicProtectedPrivateDefault
Question 1(xvi)The method to determine whether the specified char value is in uppercase or...
Question 1(xvii)Assertion (A) Method should be called explicitly either with object reference or class reference.Reason (R) Method can be any user...
Question 1(xviii)Read the following text and choose the correct answer:Public access specifier allows a class to expose its member variables and...
Question 1(xix)Assertion (A) The return statement causes program control to transfer back to the caller of the method.Reason (R) The return statement...
Question 1(xx)Correct statement to declare an integer array of 10 elements.int[ ] arr = new int[10];int arr;int arr (10);int ( ) arr = new int (10);
Question 2(i)Write the values of r and s after the execution of the following code.int p = 11, q = 21, r, s; r = ++q; s = p++; r++;
Question 2(ii)Observe the following code and find that how many times will the loop execute?int sum = 0, score = 0; double t; do { score = score...
Question 2(iii)Write the Java statement for the following mathematical expressionp=ab2+ba2p = \dfrac{a}{b^2} + \dfrac{b}{a^2}p=b2a+a2b
Question 2(iv)If a = 8, find the value of a -= ++a + a++ + 4 - a + 6.
Question 2(v)Rewrite the following code using for loop.int i = 1; int d = 5; do { d = d * 2; System.out.println(d); i++; } while(i...
Question 2(vi)Name the operators listed below.?:&&<=++
Question 2(vii)Find out the error(s) in the following code and underlining correct error(s).int m = 5; n = 10; while(n >= 1) {...
Question 2(viii)Evaluate the following expressions, when int a = 8, b = 14.(a) b/a++(b) --a + b-- + a
Question 2(ix)Write the syntax of switch statement.
Question 2(x)What will be the output of the following program segment?int a = 100; while(false) { if(a < 50) break; a = a - 10;...