File

advertisement
1. The new operator
[A] returns a pointer to a variable
[C] obtains memory for a new variable
[B] creates a variable called new
[D] tells how much memory is available
2. Which of the following statement is correct?
[A] For positive numbers, result of operators >> and >>> are same
[B] Java provides two operators to do left shift <<< and <<
[C] >> is the zero fill right shift operator
[D] >>> is the signed right shift
3. Java language has support for which of the following types of comments
[A] block, line and javadoc
[B] javadoc, literal and string
[C] javadoc, char and string
[D] single, multiple and quote
4. Command to execute a compiled java program is
[A] javac
[B] java
[C] run
5. The java compiler
[A] creates executable
[C] creates classes
[D] execute
[B] translates java source code to byte code
[D] produces java Interpreter
6. The order of the three top level elements of the java source file are
[A] Import, Package, Class
[B] Class, Import, Package
[C] Package, Import, Class
[D] Random order
7. The minimum value of char type variable is
[A] ‘\u0020’
[B] ‘\u00ff’
[C] ‘\u0010’
[D] ‘\u0000’
8. Java uses ___ to represent characters
[A] ASCII code
[B] Unicode
[C] Byte code
[D] None of the above
9. Which one is not supported by OOP?
[A] Abstraction
[B] Polymorphism
[C] Encapsulation
[D] Global variables
10. Java programs are
[A] Platform-dependent
[C] Platform-independent
[B] Interpreter-dependent
[D] Interpreter
11. Which of the following is not an valid declaration of an array?
[A] int [ ] a = new int [3];
[B] int a [ ] [ ] = new int [3] [3]
[C] int [ ] [ ] a = new int [3] [ ];
[D] int [ ] [ ] a = new int [ ] [3];
12. String.ValueOf('r').concat("def").concat(String.ValueOf('2'))
[A] 0
[B] 1
[C] 3
[D] 4
13. Which of the following is correct statement?
[A] Boolean true value is 1 and false value is 0
[B] Every private class has a wrapper class
[C] Constant identifier precede with a reserved word final
[D] System.out.println() method also flushes the
14. Size of an integer can be
[A] -231 to 231-1
[B] 0 to -216
[C] -28 to 28-1
[D] -215 to 215-1
15. For which of the following data types the ValueOf() method is NOT overloaded in the string class?
[A] Float
[B] Boolean
[C] Object
[D] None of these
16. Integer is a
[A] Adapter class
[B] Inner class
[C] Not a class
[D] Wrapper
17. Which of the following variable declaration would not compile in Java program?
[A] intVAR;
[B] intvar1;
[C] int 1_var;
[D] All are correct
18. Among these expressions, which is(are) of type String?
[A] "0"
[B] '0'
[C] [A] and [B]
[D] None of these
19. Which of the following line will not compile assuming b1, b2 and b3 are byte variables and J is Int variable?
[A] b1 = 3;
[B] b3 = b1 * b2;
[C] b3 = 10 * b1;
[D] b2 = (byte) j;
20. Which are the valid declarations for an integer literal?
(i) 0
(ii) -5
(iii) 0416
[A] (i) and (ii)
[B] (i), (ii) and (iii) [C] (iv)
(iv) 0xabcdef
[D] All of these
21. Evaluate the value of the expression? 6 - 2 + 10 % 4 + 7
[A] 10
[B] 12
[C] 13
[D] 14
22. Which of the following assignment operator does not exist in Java?
[A] >>
[B] %=
[C] >>>
[D] <<<
23. What is/are highest order precedence operator(s) in Java?
[A] ( )
[B] { }
[C] both [A] & [B] [D] None of these
24. The order of precedence from highest to lowest is:
[A] &&, /, |,{}
[B] %, <=, &&, =
[C] <, !, ==, ++
25. The && and || operators
[A] Combine two numeric values
[C] Combine two boolean values
[D] +, -, [], !=
[B] Compare two boolean values
[D] Compare two boolean values
26. Which of the following is TRUE about the switch statement in Java?
[A] A default send execution immediately to the end of the switch statement.
[B] A break send execution immediately to the end of the switch statement.
[C] A case send execution immediately to the end of the switch statement.
[D] The statements in a switch continue to execute as long as the condition at the top of the switch remains true.
27. Which of the following is a loop construct that will always be executed once?
[A] switch
[B] for
[C] while
[D] do...while
28. Which one is not a valid jump statement?
[A] return
[B] goto
[C] continue
[D] break
29. Which of the following is not a valid flow control statement?
[A] break;
[B] continue outer; [C] return;
[D] exit();
30. The break statement causes an exit
[A] only from the innermost loop.
[C] from innermost loops or switches.
[B] only from the innermost switch.
[D] terminates a program
31. Which of the following is an invalid declaration for the main method in java program?
[A] public static void main (String [ ] args)
[B] public static strictfp void main(String args[ ])
[C] final static public void main (String args[ ])
[D] All are Correct
32. A top level class may have which one of the following access modifiers?
[A] package
[B] private
[C] protected
[D] public
33. Visualizing program components as objects is characteristics of which of the following language types?
[A] Object-oriented programming language
[B] Machine language
[C] Command line operating system
[D] Procedural language
34. A subclass is also called as
[A] inner class
[B] nested class
[C] derived class
[D] hidden class
35. Attribute of an object can include information about
[A] State
[B] Method
[C] Behavior
[D] Procedures
36. Which of the following is not a wrapper class?
[A] Vector
[B] Character
[C] Boolean
[D] Integer
37. Which of the following method is used to initialize the instance variable of a class?
[A] Class
[B] Public
[C] Constructor
[D] Destructor
38. Object oriented programming method is followed in
[A] C programming language
[B] C++ programming language
[C] C# programming language
[D] Both [B] and [C]
39. The last statement in a finalize method should always be
[A] super (finalize)
[B] super finalize() [C] finalize(method name)
[D] no restrictions
40. The methods defined by Thread class that help to manage threads are :
[A] joined
[B] stop
[C] getName
[D] all of the above
41. Which of the following is not true about constructors?
[A] It initializes an object immediately upon creation
[C] The return type of class constructor is the class type itself
[B] It is syntactically similar to a method
[D] All of the above
42. A default constructor has
[A] has no arguments [B] has no return type [C] has one argument but no return type [D] has two arguments
43. When a method is made static, it cannot use
[A] this
[B] super
[C] Both [A] and [B]
[D] None the above
44. Which method of the thread class should be defined?
[A] run()
[B] start()
[C] Both [A] and [B]
[D] None of these above
45. In Java, main() method rteturns a value of type
[A] void
[B] int
[C] real
[D] string
46. In Java Inheritance
[A] all fields of a class are private
[C] a new class is derived from an existing class
47. Primary purpose of inheritance is
[A] code reuse
[B] overloading
[B] all fields of a class are protected
[D] none of these above
[C] overriding [D] ignoring irrelevant features from a software
48. Which of the following modifiers can be used to disallow a method from being overridden?
[A] final
[B] transient
[C] volatile [D] none of these above
49. In Java programming an object can take many forms. This feature called
[A] Abstraction
[B] Polymorphism [C] Encapsulation
[D] Inheritance
50. A method cannot be overridden if it is qualified by which one of the following modifier?
[A] friendly
[B] final
[C] static
[D] none of these above
51. Multiple inheritance is possible in java by means of
[A] package
[B] object
[C] interfaces
52. Method overloading
[A] is a technique for implementing abstraction
[C] is a technique for implementing encapsulation
[D] class
[B] is a technique for implementing polymorphism
[D] none of the above
53. Which of the following keyword is used to invoke superclass of an overriden method?
[A] native
[B] new
[C] super
[D] static
54. Which method/methods cannot be overridden?
[A] static
[B] final
[C] only [A]
[D] both [A] and [B]
55. Select the correct statement
[A] Method overloading is called compile time polymorphism
[B] Method overriding is called runtime polymorphism
[C] Only [B] is correct
[D] Both [A] and [B] are correct
56. Which of the following does not deal with exceptions?
[A] throws
[B] throw
[C] finalize
57. URL throws an exception called
[A] IllegalURLException
[C] MalformedHostException
[D] finally
[B] URLException
[D] MalformedURLException
58. Event handling is done by objects which
[A] Contain code for running an applet
[B] Contain code for creating a window
[C] Contain code for responding to an event generated by a logical input device
[D] Contain code for responding to program generated exceptions
59. Which class is base class for all exceptions?
[A] String
[B] Error
[C] Throwable
[D] RuntimeException
60. Java’s exception handling mechanism is meant to handle
[A] only compile time errors
[B] only syntax errors
[C] only runtime errors
[D] both runtime and compile time errors
61. When the JVM runs out of memory, which exception will be thrown?
[A] MemoryBoundException
[B] OutOfMemoryError
[C] OutOfRangeException
[D] NullReferenceException
62. In Java programming environment, the throw keyword is used
[A] to generate exception programmatically
[B] to throw exception object
[C] to catch exception object
[D] none of the above
63. Which exception is thrown by read( ) method?
[A] Exception
[B] FileNotFoundException
[C] ReadException
[D] IOException
64. Attempting to access a character that is outside the bounds of a StringBuffer results in a
[A] ArrayIndexOutOfBoundsException
[B] StringOverFlowException
[C] StringException
[D] StringIndexOutOfBoundsException
65. Exception and Error are immediate subclasses of a class called
[A] Object
[B] Throwable
[C] AWT
[D] Panel
Download