click below
click below
Normal Size Small Size show me how
oopf3
not sufe if f3 to
| Question | Answer |
|---|---|
| OOP describes the task to be performed on objects. | true |
| Which one of these is a data type? | byte |
| Which statement(s) best describes an object's behavior? | Behavior acts like the verbs of an object.? |
| Which concept of Java is achieved by combining methods and attribute into a class? | Encapsulation |
| The focus of procedural programming is to break down a programming task into a collection of variables, data structures, and subroutines | true? |
| a variable that is accessible within and outside the package but through inheritance only. | protected variable |
| method variables are variables used in a method | true |
| Standard Methods – implement the business rules for which the application is being developed | true? |
| Access (Getter) – a method that is used to access or retrieve data. | true? |
| final Variable: constant variable | true? |
| In Inheritance, the programmer can change one part of the code without affecting other parts | true? |
| There is no security of data with Encapsulation | false |
| Which feature can be implemented using encapsulation? | Abstraction |
| Which of the following is not an advantage to using inheritance? | One big superclass can be used instead of many little classes. |
| Using encapsulation data security is ___________ | ensured to some extent |
| Which among the following is correct for the following code? class A { public : class B { public : B(int i): data(i) { } int data; } }; class C: public A { class D:public A::B{ }; }; | Single level inheritance is used, with both enclosing and nested classes |
| Single level inheritance will be best for___________ | Inheriting a class which performs all the calculations |
| Which access type data gets derived as private member in derived class? | Private |
| Members which are not intended to be inherited are declared as ________________ | Private members? |
| What is the output of the following program? class A { float sal=40000; } class B extends A { int salBonus=10000; public static void main(String args[]) { B p=new B(); System.out.println("B salary is:"+p.sal); System.out.println("Bonus of B is:"+p.bonus); | Compile time error? |
| 16/20 | |
| Encapsulation means "open to all" and indicates that the internal workings of an object are entirely visible to the outside world. | false? |
| Which of the following is not OOPS concept in Java? | Compilation? |
| True or False: This line of code is correct System.out.println("Hi!"); | true? |
| this keyword can be passed as an argument in the method call. Group of answer choices true false | true |
| a method that is only accessible within the class where it is declared. | private? |
| This – contains a reference to the current object being constructed Group of answer choices false true | true? |
| Constructor – a method that is automatically executed when an object is created. This method is used to initialize the attributes. Group of answer choices false true | true? |
| this can be used to refer current class instance variable. Group of answer choices true false | true? |
| There is an Increased security of data with Encapsulation Group of answer choices false true | true? |
| 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 constructor will be called first from the classes involved in single inheritance from object of derived class? | Base class constructor? |
| Single level inheritance is safer than _____________ | Multiple inheritance |
| If base class contains 2 nested classes, will it be possible to implement single level inheritance? | yes always? |
| Which concept will result in derived class with more features (consider maximum 3 classes)? | Multilevel inheritance? |
| How many classes can be inherited by a single class in java? | 1 |
| 18/20 | |
| Which of the following is a mechanism by which object acquires the properties of another object? | Inheritance |
| ________ is a technique of solving a problem and breaking it down into smaller parts and solving each of the smaller problems. | Procedural Programming |
| Which statement(s) best describes inheritance? | When a child object inherits from its parent, only the additional attributes and behavior must be coded, which is one of the benefits of OOP.? The child object inherits from its parent, adding specialized attributes and behavior? |
| static Variables are variables stored in the class and are available to all objects of a class or objects of other classes if access is permitted | true? |
| Class Variables are variables stored in each object of a class, usually referred to as the non-static member fields of a class. | true? |
| a variable that is accessible from all classes. | public? |
| this - It represents an instance of the class in which it appears | true? |
| Encapsulation has Better control of class attributes and methods | true? |
| Abstraction is the way to add functions in a user defined structure. | False |
| Encapsulation is implemented by using__________ | private? |
| Encapsulation has poor control of class attributes and methods | false? |
| If class A and class B are derived from class C and class D, then ________________ | Those are 2 pairs of single inheritance |
| If a derived class object is created, which constructor is called first? | Base class constructor? |
| 19 | |