30 solutions available
Question 1(i)Consider the below picture and choose the correct statement from the following:Polygon is the object and the pictures are classesBoth...
Question 1(vii)if (a>b&&b>c) then largest number is:bcawrong expression
Question 1(viii)What is the output of Math.ceil(5.4)+Math.ceil(4.5)?10.011.012.09.0
Question 1(ix)What is the method to check whether a character is a letter or...
Question 1(x)The extension of a Java source code file is:exeobjjvmjava
Question 1(xi)The number of bytes occupied by a character array of four rows and three columns are:12249648
Question 1(xii)Which of the following data type cannot be used with switch case construct?intcharStringdouble
Question 1(xiii)Which of the following are entry controlled loops?(a) for(b) while(c) do..while(d) switchonly aa and ba and cc and d
Question 1(xiv)Method which reverses a given number is:Impure methodPure methodConstructorDestructor
Question 1(xv)If the name of the class is "Yellow", what can be the possible name for its constructors?yellowYELLOWYellYellow
Question 1(xvi)Invoking a method by passing the objects of a class is termed as:Call by referenceCall by valueCall by methodCall by constructor
Question 1(xvii)The correct statement to create an object named mango of class fruit:Fruit Mango= new fruit();fruit mango = new fruit();Mango...
Question 1(xviii)Assertion (A): Static method can access static and instance variables.Reason (R): Static variable can be accessed only by static...
Question 1(xix)What is the output of the Java code given below?String color[] = {"Blue", "Red", "Violet"}; System.out.println(color[2].length());6532
Question 1(xx)Which of the following mathematical methods returns only an integer?Math.ceil(n)Math.sqrt(n)Math.floor(n)Math.round(n)
Question 2(i)Write Java expression for:∣𝑎+𝑏∣a2+b2\dfrac{|𝑎 + 𝑏|}{\sqrt{a^2 + b^2}}a2+b2∣a+b∣
Question 2(ii)Evaluate the expression when x is 4:x += x++ * ++x % 2;
Question 2(iii)Rewrite the following do while program segment using for:x = 10; y = 20; do { x++; y++; } while (x<=20);...
Question 2(iv)Give the output of the following program segment. How many times is the loop executed?for(x=10; x>20;x++) System.out.println(x);...
Question 2(v)String s1 = "45.50"; String s2 = "54.50"; double d1=Double.parseDouble(s1); double d2=Double.parseDouble(s2); int x= (int)(d1+d2);What...
Question 2(vi)Consider the following two-dimensional array and answer the questions given below:int x[ ][ ] = {{4,3,2}, {7,8,2}, {8, 3,10}, {1, 2,...
Question 2(vii)Differentiate between boxing and unboxing.
Question 2(viii)The following code to compare two strings is compiled, the following syntax error was displayed – incompatible types – int cannot be...
Question 2(ix)Consider the given program and answer the questions given below:class temp { int a; temp() { a=10; } temp(int z) { a=z; }...
Question 2(x)Primitive data types are built in data types which are a part of the wrapper classes. These wrapper classes are encapsulated in the...
Question 4Define a class to overload the method perform as follows:double perform (double r, double h) — to calculate and return the value of curved...
Question 5Define a class to accept a number from user and check if it is an EvenPal number or not.(The number is said to be EvenPal number when...
Question 6Define a class to accept values into an integer array of order 4 x 4 and check whether it is a DIAGONAL array or not. An array is DIAGONAL...
Question 7Define a class pin code and store the given pin codes in a single dimensional array. Sort these pin codes in ascending order using the...
Question 8Define a class to accept the gmail id and check for its validity.A gmail id is valid only if it has:→ @→ .(dot)→ gmail→ comExample:...