Page 1 :
COMPUTER APPLICATION, Maximum Marks: 50, Time allowed: One hour (inclusive of reading time), ALL QUESTIONS ARE COMPULSORY, , The marks intended for questions are given in brackets [], Select the correct option for each of the following questions., , SECTION A (30 Marks), [5x1], . Which of the following is smallest integer data type?, , (A) short, (B) Byte, (C) byte, (D) bit, , . A value of a type — like int- will always require the same amount of, memory to store one value., , a. Basic c. Primitive, b. Double d. None of these, , . What is meant by access specifier “default” in a method definition?, , a. Accessible only within the class, , b. Accessible by any other class anywhere, , Accessible to classes in the same package but not by classes in other packages, None of these, , af, , . Which of the following types of functions does not return a value?, , a. Pre method c. Specific method, b. Mutator method d. None of these, , . Aconstructor that takes no arguments and has a body that does nothing is called:
Page 2 :
a. Default constructor, , b. Invoked constructor, , c. Parametrized constructor, d. None of these, , 6. What will be the output of the following code?, int c = (3<4)? 3*4:344;, , a 7, b. 12, ec 19, d 2.5, , 7. A Java program developed and executed by the users without using web browser is, known as:, , a. application c. object, b. applet d. none, , 8. Java is a case sensitive language. Which is the most appropriate statement with respect to, this context?, , Upper and lower case letters are distinguished., Upper and lower case letters are ignored., Only lower case letters are distinguished., None., , RBege, , 9. An object is said to be a, data., , a. non-primitive ec. basic, b. primitive d. None, , 10. Division by a variable that contains a value zero is called. error., , a. compile ec. BothA andB, , time d. None, b. run time
Page 3 :
11. What will be the output of the following code snippet?, System.out.printIn(Math.floor(-4.7));, , (A) -8.14, (B) 22.09, (C) -5.0, , (D) None, , 12, What will be the output of the following code snippet?, System.out.printin(Math.ceil(3.4)+Math.pow(2,3));, , (A) 11.0, (B) 12.5, (C) 12.0, (D) None, , 13. Which returns the cube root of its argument as a double value., a. Math.cbrt(), b. Math.cuberoot(), c. Math.rootcube, d. None, , 14. A compound statement can be stated as, , a. p=in.nextint(); q=in.nextint();, b. m=++a;, n=--b;, c. if(a>b), {at++:b--;}, d. none, 15. if(a<b) c=a; else c=b, It can be written as:, a. c= (b<a)?a:b;, (B) c= (a!=b)?azb;, (C) c= (a<b)?b:a;, (D) none, , 16. Predict the output of the following code snippet:, int a=1,b=2,c=3;
Page 4 :
switch(p), , {, , case |: at++;, case 2: ++b;, break;, , case 3: c--;, , }, , System.out.printin(a + ","+ b +"," +c);, , Tf the value of P =1, then find the output:, (A) 2,33, , (B) 4,5,5, , (C) 5,6,6, , (D) None, , 17. What will be the output of the following code?, , int m=2;, , int n=15;, , for(int i=1;1<5;i++), , m++;, , --n;, System.out.printin("m="+m);, System.out.printin("n="+n);, , (A) m=6 (Cc) m=20, n=14 n=15, (B) m=17 (D) None, n=19, 18. A class is called an because it creates objects and uses them., , a. Object destructor, b. Object modifier, , c. Object factory, d. Object updater, , 19. Suppose num! and num2 are two double type variables that you want to add, as an integer form and assign to a variable res of type int. Choose the correct, statement for given task., , a. res = (int) (numl+num2);
Page 5 :
b. res = numl+num2;, c. res = (double) num!+num?;, d. res = (long) num!+num2;, , 20. statement will repeat a loop for the next iteration after ignoring some, statements of the loop., , a. break, , b. continue, ec. default, d, None, , 21. Which of the following are valid identifiers?, , (i) Games, , (ii) flag, , (iii) INCOME_TAX, (iv) Break, , 1. (i) & (iii), , 2. (iii) & (iv), , 3. All of the above, 4. None of the above, , 22.A____ function does not change or modify the state of their parameters, received., a. pure, b. impure, c. actual, d. None, , 23. What type of casting shown by the following examples?, , double x=15.2; int y=(int) x;, a. Implicit c. Both first and second options, , b. Explicit d. None, , 24. What is the range of byte data type in Java?, , (A) -128 to 127 (C) -2147483648 to 2147483647, (B) -32768 to 32767 (D) None of the mentioned