JP Assignment 6
JP Assignment 6
(A) Abst
(B) Abstract
(C) Abstract class
(D) Virtual
11. A variable’s _______ indicates where the variable can be used in an application
code.
(A) Scope
(B) Lifetime
(C) Place
(D) Position
20. Which of the following is used to declare, construct, and initialize an array?
(A) int an[][] = { {1, 2, 3}, {1, 4} };
(B) int an[] = new int(5);
(C) int an() = new int[];
(D) array an = new array();
23. The correct syntax to import the math library in Java is:
(A) import java.lang.math;
(B) import math;
(C) import java.math.*;
(D) All of these
28. Runnable is a:
(A) Class
(B) Method
(C) Variable
(D) Interface
38. Which class in Java is used to take input from the user?
(A) Scanner
(B) Input
(C) Applier
(D) None
49. What is the process of defining two or more methods with the same name but
different parameters in the same class?
(A) Method overloading
(B) Method overriding
(C) Method hiding
(D) None of the mentioned
54. Which of these methods of the String class can be used to test two strings for
equality?
(A) isequal()
(B) isequals()
(C) equal()
(D) equals()
56. Can command line arguments be converted into int automatically if required?
(A) Yes
(B) No
(C) Compiler Dependent
(D) Only ASCII characters can be converted
57. Which of these methods are given parameters via command arguments?
(A) main()
(B) recursive() method
(C) Any method
(D) System defined methods
61. Which keyword is used to prevent the content of a variable from being
modified?
(A) Final
(B) Constant
(C) Static
(D) None of the above
64. When a local variable has same name as instance variable, it's called:
(A) Serialization
(B) Variable shadowing
(C) Polymorphism
(D) Multi-threading