click below
click below
Normal Size Small Size show me how
OOP F3 (M5 M6)
| Question | Answer |
|---|---|
| Which of the following is a type of polymorphism in Java? | Compile time polymorphism |
| Which of following statement(s) can result in new object instance creation if executed successfully. | All |
| Which concept of Java is a way of converting real world objects in terms of class? | Abstraction |
| Where does a java program start executing instructions from: | main method |
| What is the difference between a class and an object? | A class is a blueprint to make an object |
| Custom Methods – implement the business rules for which the application is being developed | true |
| Instance Variables are variables stored in each object of a class, usually referred to as the non-static member fields of a class. | true |
| this - It can be used to access class variables and methods. | true |
| this() can be used to invoke current class constructor. | true |
| a variable that is accessible from all classes. | public variable |
| Which of the following is not an advantage to using inheritance? | One big superclass can be used instead of many little classes. |
| If data members are private, what can we do to access them from the class object? | Create public member functions to access those data members |
| Encapsulation is implemented by using private | true |
| In Inheritance, the programmer can change one part of the code without affecting other parts | false |
| In Encapsulation, Class variables can be made read-only or write-only | true |
| Which among the following is correct for a hierarchical inheritance? | One base class can be derived into other two derived classes or more |
| Which among the following best describes multiple inheritance? | More than one class being parent of single child |
| If single inheritance is used, program will contain ________________ | At least 2 classes |
| Single level inheritance is safer than _____________ | Multiple inheritance |
| A _____ is a procedure associated with a class that describes an action an object is able to perform. | method |
| True or False: // allows for a single line comment? | True |
| What is it called if an object has its own lifecycle and there is no owner? | Association |
| Select correct statements about class(es). | All |
| Which statement(s) best describes an object's behavior? | Behavior acts like the verbs of an object. |
| Global Variables are variables used in a method | false |
| _________– a method that is used to access or retrieve data. | Accessor (Getter) |
| this - It represents an instance of the class in which it appears | true |
| Accessor (Getter) – a method that is used to change the data. | false |
| final Variable: constant variable | true |
| Encapsulation is implemented by using private | true |
| In Inheritance, the programmer can change one part of the code without affecting other parts | false |
| Encapsulation is implemented by using__________ | private |
| Which type of inheritance cannot involve private inheritance? | All types can have private inheritance |
| Which programming language doesn't support multiple inheritance? | Java |
| Method overriding is combination of inheritance and polymorphism? | True |
| What is it called where child object gets killed if parent object is killed? | Composition |
| OOP describes the task to be performed on objects. | true |
| Custom Methods – implement the business rules for which the application is being developed | true |
| a method that is accessible within and outside the package but through inheritance only. | protected |
| This – contains a reference to the current object being constructed | false |
| a variable that is accessible within and outside the package but through inheritance only. | protected variable |
| Which among the following violates the principle of encapsulation almost always? | Global variables |
| Which among the following would destroy the encapsulation mechanism if it was allowed in programming? | Using access declaration for private members of base class |
| Encapsulation is supported by ___________ | Classes |
| Encapsulation has poor control of class attributes and methods | false |
| While using encapsulation, which among the following is possible? | Data member's data type can be changed without changing any other code |
| How can you make the private members inheritable? | It can be done both by making the visibility mode public or protected |
| Which concept will result in derived class with more features (consider maximum 3 classes)? | Multiple inheritance |
| If base class contains 2 nested classes, will it be possible to implement single level inheritance? | Yes, always |
| Which among the following best defines single level inheritance? | A class inheriting a base class |
| ___________– a method that is used to change the data. | Mutator (Setter) |
| Local Variables are variables used in a method | true |
| Accessor (Getter) – a method that is used to access or retrieve data. | true |
| a variable that is only accessible within a class where it is declared | private variable |
| Which among the following should be encapsulated? | The data which is prone to change is near future |
| How can Encapsulation be achieved? | Using Access Specifiers |
| Which among the following best describes encapsulation? | It is a way of combining various data members and member functions that operate on those data members into a single unit |
| If class A and class B are derived from class C and class D, then ________________ | Those are 2 pairs of single inheritance |
| How many types of inheritance can be used at a time in a single program? | Any type, any number of times |
| Members which are not intended to be inherited are declared as ________________ | Private members |
| Which among the following best describes the Inheritance? | Using the data and functions into derived segment |
| Sally is writing some Object-Oriented Program code for a vehicle which contains the attributes (manufacturer, color, and price), along with what she wants the vehicle to be able to do (start, drive, and park). This is known as _____. | class |
| Which of the following concept is often expressed by the phrase, 'One interface, multiple methods'? | Polymorphism |
| object-oriented programming, it is to break down a programming task into objects that expose behavior (methods) and data (members or attributes) using interfaces. | true |
| Constructor – a method that is automatically executed when an object is created. This method is used to initialize the attributes. | true |
| method variables are variables used in a method | true |
| Construct – a method that is automatically executed when an object is created. This method is used to initialize the attributes. | false |
| a method a method that is accessible from all classes. | public method |
| The encapsulation is achieved by combining which ones into a class? | Methods and Attribute |
| The private members of the base class are visible in derived class but are not accessible directly. | True |
| If multi-level inheritance is used, First class B inherits class A, then C inherits B and so on. Till how many classes can this go on? | There is no limit |
| Which concept of Java is achieved by combining methods and attribute into a class? | Encapsulation |
| How do I print out numbers on JAVA? | System.out.println(#); |
| ________ describes the task to be performed on objects. | OOP |
| Which one of these is a data type? | byte |
| Which of the following is not OOPS concept in Java? | Compilation |
| this – contains a reference to the current object being constructed | true |
| Construct – a method that is automatically executed when an object is created. This method is used to initialize the attributes. | false |
| non-static Variables are variables stored in each object of a class, usually referred to as the non-static member fields of a class. | true |
| Custom Methods – used to change or access the private data in an object. | false |
| Standard Methods – implement the business rules for which the application is being developed | false |
| Which feature can be implemented using encapsulation? | Abstraction |
| Encapsulation is the way to add functions in a user defined structure. | False |
| Which constructor will be called first from the classes involved in single inheritance from object of derived class? | Base class constructor |
| How many classes can be inherited by a single class in java? | Only 1 |
| Which of the these is the functionality of 'Encapsulation'? | Binds together code and data |
| When Overloading does not occur? | More than one method with same name, same number of parameters and type but different signature |
| As a blueprint is a design for a house, a class is a design for a: | object |
| Standard Methods – used to change or access the private data in an object. | true |
| a method that is only accessible within the class where it is declared. | private method |
| There is an Increased security of data with Encapsulation | true |
| Encapsulation has Better control of class attributes and methods | true |
| If a base class is inherited in protected access mode then which among the following is true? | Public and Protected members of base class becomes protected members of derived class |
| Single level inheritance will be best for___________ | Inheriting a class which performs all the calculations |
| Procedural Programming is a technique of solving a problem and breaking it down into smaller parts and solving each of the smaller problems. | true |
| Mutator (Setter) – a method that is used to change the data. | true |
| _________– used to change or access the private data in an object. | Standard Methods |
| In Encapsulation, the programmer can change one part of the code without affecting other parts | true |
| Which is the correct syntax of inheritance? | class derived_classname : access base_classname{ /*define class body*/ }; |
| Which amongst the following is true for hybrid inheritance? | Constructor calls are usual |