30 solutions available
Question 1(i)Which of the following is/are principle(s) of Object Oriented Programming?EncapsulationAbstractionInheritanceAll of these
Question 1(ii)If a = 8 and b = 4, the value of a % = b is2048
Question 1(iii)Predict the output of the following code snippet:int a = 1; int b = 2; if (a == b) System.out.println("Both values are equal");...
Question 1(iv)Which of the following is mandatory in the switch statement?breakcontinuecasedefault
Question 1(v)Which of the following is not a valid method of the Scanner class?next( )nextInt( )nextLong( )nextNumber( )
Question 1(vi)What will be the output of Math.floor(-20.10);?-20.0-21.02021
Question 1(vii)Which of the following is an illegal identifier?age123abc_value$\text{\textdollar}$salary
Question 1(viii)Which of the following is/are jump statement used in Java?breakcontinuereturnAll of these
Question 1(ix)Class initialisation is the ............... initialisation of class fields of values.explicitimplicitBoth a and bNone of the above
Question 1(x)Operations like square root, sine and cosine areimpure functionspure functionsstatic functionsclass functions
Question 1(xi)Given array int x[ ] = {11, 22, 33, 44}; the value of x[1 + 2] is :11223344
Question 1(xii)A linear 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)Method that converts a character to uppercase istoUpper()ToUpperCase()TOUPPERCASE()toUpperCase(char)
Question 1(xiv)Give the output of the following codeSystem.out.println("Good".concat("Day"));GoodDayGood DayGooddaygoodDay
Question 1(xv)The array char arr[8] occupies :3281624
Question 1(xvi)This access specifier achieves the lowest level of accessibility.PublicProtectedPrivateDefault
Question 1(xvii)Assertion (A) Line comment is used for a single line of comment.Reason (R) A line comment starts with forward slash and...
Question 1(xviii)Read the following text and choose the correct answer:Byte streams are used to perform input and output of 8-bytes. They are used to...
Question 1(xix)Assertion (A) The private access specifier achieves the lowest level of accessibility.Reason (R) The private methods and fields can be...
Question 1(xx)State the data type after the following is executed :char ch = '9'; res = Character.isDigit(ch);intcharstringboolean
Question 2(i)State the number of bytes and bits occupied by a character array of 20 elements.
Question 2(ii)IfString x = "Computer"; String y = "Science";What will the following return?(a) System.out.print(x.substring(2,6));(b)...
Question 2(iii)Write the Java statement for the following mathematical expression :x = (a+b)2a+b\dfrac{(a + b)^2}{\sqrt{a + b}}a+b(a+b)2
Question 2(iv)Find the value of ++a * (a++ + 5) + 3 * --a, if a = 12.
Question 2(v)State the type of errors, if any in the following statements.(a)switch (x < 2)(b)int a = 100, b = 0; System.out.println (a / b);
Question 2(vi)What will be the output of the following code?int num = 10; if (num < 20) System.out.print(num++); else...
Question 2(vii)Find the output of the given code.int a, b = 100; for (a = 10; a <= 12; a++) { b += a; } System.out.print("a:" + a + " " +...
Question 2(viii)The following code has some error(s). Identify the errors and write the corrected code.Int x = 4, y = 8; { y = y + (x++) } while...
Question 2(ix)State the method that determines, if the specified character is an uppercase character.
Question 2(x)Write the return data type of the following functions.(a) startsWith( )(b) log( )