30 solutions available
Question 1(i)Name the below structure:One dimensional arrayTwo Dimensional array with 4 rows and 5 columnsThree dimensional arrayTwo Dimensional...
Question 1(ii)"Java compiled code (byte code) can run on all operating systems"— Name the feature.Robust and SecureObject OrientedPlatform...
Question 1(iii)The size of '\n' is:2 bytes4 bytes8 bytes16 bytes
Question 1(iv)Identify the operator that gets the highest precedence while evaluating the given expression:a + b % c * d - e+%-*
Question 1(v)Which of the following is a valid java keyword?IfBOOLEANstaticSwitch
Question 1(vi)The output of the following code is:System.out.println(Math.ceil(6.4) + Math.floor(-1-2));3.0434.0
Question 1(vii)Which of the following returns a String?length()charAt(int)replace(char, char)indexOf(String)
Question 1(viii)Which of the following is not true with regards to a switch statement?checks for an equality between the input and the case...
Question 1(ix)Consider the array given below:char ch[] = {'A','E','I','O', 'U'};Write the output of the following...
Question 1(x)To execute a loop 10 times, which of the following is correct?for (int i=11;i<=30;i+=2)for (int i=11;i<=30;i+=3)for (int...
Question 1(xi)A single dimensional array has 50 elements, which of the following is the correct statement to initialize the last element to...
Question 1(xii)Method prototype for the method compute which accepts two integer arguments and returns true/false.void compute (int a, int b)boolean...
Question 1(xiii)The statement that brings the control back to the calling method is:breakSystem.exit(0)continuereturn
Question 1(xiv)The default value of a boolean variable is:False0falseTrue
Question 1(xv)The method to convert a lowercase character to uppercase is:String.toUpperCase( )Character.isUppercase( char )Character.toUpperCase(...
Question 1(xvi)Assertion (A): Integer class can be used in the program without calling a package.Reason (R): It belongs to the default package...
Question 1(xvii)A student executes the following code to increase the value of a variable ‘x’ by 2.He has written the following statement, which is...
Question 1(xviii)The statement used to find the total number of Strings present in the string array String s[] is:s.lengths.length()length(s)len(s)
Question 1(xix)Consider the following program segment in which the statements are jumbled, choose the correct order of statements to swap two...
Question 1(xx)Assertion (A): An argument is a value that is passed to a method when it is called.Reason (R): Variables which are declared in a method...
Question 2(i)Rewrite the following code using single if statement.if(code=='g') System.out.println("GREEN"); else if(code=='G')...
Question 2(ii)Evaluate the given expression when the value of a=2 and b=3b*=a++ - ++b + ++a; System.out.println("a= "+a); System.out.println("b=...
Question 2(iii)A student executes the following program segment and gets an error. Identify the statement which has an error, correct the same to get...
Question 2(iv)Write the Java expression for x3+y\sqrt[3]{x}+ \sqrt{y}3x+y
Question 2(v)How many times will the following loop execute? Write the output of the code:int x=10; while (true){ System.out.println(x++ * 2);...
Question 2(vi)Write the output of the following String methods:String x= "Galaxy", y= "Games";(a) System.out.println(x.charAt(0)==y.charAt(0));(b)...
Question 2(vii)Predict the output of the following code snippet:char ch='B', char chr=Character.toLowerCase(ch); int n=(int)chr-10;...
Question 2(viii)A student is trying to convert the string present in x to a numerical value, so that he can find the square root of the converted...
Question 2(ix)Consider the following program segment and answer the questions below:class calculate { int a; double b; calculate() { a=0;...
Question 2(x)Consider the following program segment and answer the questions given below:int x[][] = { {2,4,5,6}, {5,7,8,1}, {34, 1, 10, 9}};(a) What...