30 solutions available
Question 1(i)A mechanism where one class acquires the properties of another class:PolymorphismInheritanceEncapsulationAbstraction
Question 1(ii)Identify the type of operator &&:ternaryunarylogicalrelational
Question 1(iii)The Scanner class method used to accept words with space:next()nextLine()Next()nextString()
Question 1(iv)The keyword used to call package in the program:extendsexportimportpackage
Question 1(v)What value will Math.sqrt(Math.ceil(15.3)) return?16.0164.05.0
Question 1(vi)The absence of which statement leads to fall through situation in switch case statement?continuebreakreturnSystem.exit(0)
Question 1(vii)State the type of loop in the given program segment:for (int i = 5; i != 0; i -= 2) System.out.println(i); finiteinfinitenullfixed
Question 1(viii)Write a method prototype name check() which takes an integer argument and returns a char:char check()void check (int x)check (int...
Question 1(ix)The number of values that a method can return is:1234
Question 1(x)Predict the output of the following code snippet:String P = "20", Q ="22"; int a = Integer.parseInt(P); int b = Integer.valueOf(Q);...
Question 1(xi)The String class method to join two strings is:concat(String)<string>.joint(string)concat(char)Concat()
Question 1(xii)The output of the function "COMPOSITION".substring(3, 6):POSIPOSMPOMPOS
Question 1(xiii)int x = (int)32.8; is an example of ............... typecasting.implicitautomaticexplicitcoercion
Question 1(xiv)The code obtained after compilation is known as:source codeobject codemachine codejava byte code
Question 1(xv)Missing a semicolon in a statement is what type of error?LogicalSyntaxRuntimeNo error
Question 1(xvi)Consider the following program segment and select the output of the same when n = 10 :switch(n) { case 10 :...
Question 1(xvii)A method which does not modify the value of variables is termed as:Impure methodPure methodPrimitive methodUser defined method
Question 1(xviii)When an object of a Wrapper class is converted to its corresponding primitive data type, it is called as ..................
Question 1(xix)The number of bits occupied by the value ‘a’ are:1 bit2 bits4 bits16 bits
Question 1(xx)Method which is a part of a class rather than an instance of the class is termed as:Static methodNon static methodWrapper classString...
Question 2(i)Write the Java expression for (a + b)x.
Question 2(ii)Evaluate the expression when the value of x = 4:x *= --x + x++ + x
Question 2(iii)Convert the following do…while loop to for loop:int x = 10; do { x––; System.out.print(x); }while (x>=1);
Question 2(iv)Give the output of the following Character class methods:(a) Character.toUpperCase ('a')(b) Character.isLetterOrDigit('#')
Question 2(v)Rewrite the following code using the if-else statement:int m = 400; double ch = (m>300) ? (m / 10.0) * 2 : (m / 20.0) - 2;
Question 2(vi)Give the output of the following program segment:int n = 4279; int d; while(n > 0) { d = n % 10; System.out.println(d); n = n /...
Question 2(vii)Give the output of the following String class methods:(a) "COMMENCEMENT".lastIndexOf('M')(b) "devote".compareTo("DEVOTE")
Question 2(viii)Consider the given array and answer the questions given below:int x[ ] = {4, 7, 9, 66, 72, 0, 16};(a) What is the length of the...
Question 2(ix)Name the following:(a) What is an instance of the class called?(b) The method which has same name as that of the class name.
Question 2(x)Write the value of n after execution:char ch ='d'; int n = ch + 5;