(1) Which of the following defines attributes and methods? (A) Class (B) Object (C) Instance (D) Variable (2) Which of the following keyword is used to declare Class variables and class methods? (A) static (B) private (C) public (D) package (3) Which of the following method can be called without creating an instance of a class? (A) Instance method (B) Class method (C) Constructor method (D) All of these (4) Which of the following refers more than one method having same name but different parameters? (A) Overloaded methods (B) Overridden methods (C) Duplicate methods (D) All of these (5) Which method is invoked automatically with creation of an object? (A) Instance method (B) Constructor (C) Class method (D) All of these (6) Which of the following is the keyword used to refer a superclass constructor in subclass constructor? (A) extends (B) super (C) name of the superclass (D) new (7) Which of the following is used to invoke an instance method in Java? (A) The name of the object, colon (:) and the name of the method (B) The name of the object, dot (.) and the name of the method (C) The name of the class, colon (:) and the name of the method (D) The name of the class, dot (.) and the name of the method (8) Which of the following is accessible by instance methods? (A) Only instance variables (B) Only class variables (C) Both (A) and (B) (D) None of these (9) When methods in the superclass and subclass have same name and signature, what are they called? (A) Overloaded methods (B) Overridden methods (C) Inherited methods (D) All of these (10) Which method of Java class is used if we want to allow other methods to modify the data value? (A) Set or Setter (B) Get or Getter (C) Both (A) and (B) (D) None of these (11) How does the Constructor differ from general method in Java? (A) It must have the same name as class. (B) It does not have return type. (C) It can’t be invoked explicitly in the program. (D) All of these (12) How many levels of visibility are used to protect a method or variable from such reference in Java? (A) 1 (B) 2 (C) 3 (D) 4 (13) In Java class, in which step a new keyword is used to create the object by allocating memory? (A) Declaration (B) Instantiation (C) Initialization (D) All of these (14) In Java, which variable are defined with in a class, outside any method with static keyword? (A) Global variable (B) Class variable (C) Instance variable (D) Local variable (15) How do you identify the variable which is define with in a class, out-side any method with the static keyword in Java? (A) Local variables (B) Instance variables (C) Class variables (D) None of these (16) Java class is generally made up of which components? (A) behaviour, variable (B) attributes, behaviour (C) name, attributes (D) name, variable (17) A variable declared using class type can store what to an object? (A) relation (B) root (C) rate (D) reference (18) Which class inherits all instance variables and methods from super class and it may have its own added variables and methods? (A) Out class (B) Super class (C) In class (D) Sub class (19) Instance variables and instance methods are accessed via objects. They can be referred by using which operator? (A) // (B) dot (.) (C) $ (D) # (20) Which type of variables are defined within a class but outside any method? (A) Class variable (B) Empty variable (C) Local variable (D) Instance variable (21) In Java, we can have different methods that have the same name but a different signature is also called as what? (A) Method overloading (B) Variable overloading (C) Class overloading (D) Signature overloading (22) In Java, while using inheritance – “Child class” can be referred to as which of the following? (A) Sub class (B) Derived class (C) Extended class (D) All of these (23) Java have a __________ that looks for unused objects and reclaims the memory that those objects are using. (A) reclaim collector (B) unused collector (C) memory collector (D) garbage collector (24) Which of the following is syntax of package? (A) package {Name} (B) package (Name); (C) package <Package Name>; (D) package [Variable name]; (25) Which are the four P’s used in the four levels of visibility to provide necessary protection? (A) Process, Private, Protected, Public (B) Public, Package, Protected, Private (C) Public, Package, Protected, Process (D) Private, Package, Protected, Public (26) Highest level of protection can be achieved by using which protection level? (A) Private (B) Public (C) Protected (D) Package (27) Who allows us to build new class with added capabilities by extending existing class? (A) Inheritage (B) Instant (C) Inheritance (D) Instance (28) In Java, a class is defined using which keyword? (A) class (B) public (C) static (D) main (29) Which steps are followed to create an object from a class? (A) Declaration (B) Instantiation (C) Initialization (D) All of these (30) In Object oriented programming (OOP) languages what is known for creating an object? (A) Object Instantiation (B) Object creation (C) Object Making (D) None of these (31) Variables defined inside methods or blocks are known as which type of variable? (A) Local variables (B) Instance variables (C) Class variables (D) Block variables (32) Which word means “many forms”, different forms of methods with same name in Java? (A) Inheritance (B) Polymorphism (C) Aggregation (D) Composition (33) In Java, from the following which visibility modifiers are used to protect a method or variable from another class? (A) Public (B) Package (C) Protected and Private (D) All of these (34) If we want to allow data to be used by others, we write which type of method in Java? (A) getter (B) setter (C) main (D) void (35) In Java, which type of visibility modifier level of protection is used to allow the access only to sub classes or to share with the methods declared as “friend”? (A) Public (B) Package (C) Protected (D) Private (36) Which keyword is used to create the object which allocates memory in Java? (A) new (B) add (C) int (D) create (37) All instances of class allocated memory in data structure in Java and it is known as which of the following? (A) Directory (B) File (C) Heap (D) Buffer (38) In Java, if we want protected data to be modified by others then which methods are to be written? (A) Accessor (B) Getter (C) Mutator (D) Both (A) and (B) (39) Composition and Aggregation establish which type of relationship between classes in Java? (A) has - a (B) is – a (C) was – a (D) as – a (40) In Java, ‘Visibility Modifiers’ – ‘Protected’ members are available as which members in the inherited subclass? (A) Object (B) Public (C) Instance (D) Private