click below
click below
Normal Size Small Size show me how
CCS0070 M5 - M6
| Question | Answer |
|---|---|
| An object is an instance of a: | class |
| Which concept of Java is a way of converting real world objects in terms of class? A) Inheritance B) Encapsulation C) Polymorphism D) Abstraction | Abstraction |
| A _____ is a procedure associated with a class that describes an action an object is able to perform. A) Field B) Constructor C) Method | Method |
| Which one of these is a data type? bit byte gold fold | byte |
| [T / F]Global Variables are variables used in a method | False |
| These variables identify the data stored in the object. A) Methods B) Parameters C) Instance variables D) Local variables | Instance variables / Attributes |
| [T / F] Access (Getter) – a method that is used to access or retrieve data. | True |
| [T / F] this - It represents an instance of the class in which it appears | True |
| [T / F] This – contains a reference to the current object being constructed | False |
| Which among the following violates the principle of encapsulation almost always? Global variables Public variables Local variables Array variables | Global variables |
| [T / F] There is an Increased security of data with Encapsulation | True |
| [T / F] Encapsulation is implemented by using private | True |
| It is a way of combining various data members and member functions that operate on those data members into a single unit A) Abstraction B) Inheritance C) Polymorphism D) Encapsulation | Encapsulation |
| How can Encapsulation be achieved? Using inheritance Using Access Specifiers Using only private members Using Abstraction | Using Access Specifiers |
| [T / F] The private members of the base class are visible in derived class but are not accessible directly. | True |
| [T / F] The private member's are made public to all the classes in inheritance. | False |
| How many classes can be inherited by a single class in java? Only 1 2 - 3 As many | Only 1 |
| [T / F] In hierarchical inheritance, all the classes involve some kind of inheritance. | True |
| As a blueprint is a design for a house, a class is a design for a: class object attribute | object |
| What is it called where child object gets killed if parent object is killed? A) Inheritance B) Aggregation C) Composition D) Polymorphism | Composition |
| A _____ is a procedure associated with a class that describes an action an object is able to perform. A) Field B) Constructor C) Method D) Interface | method |
| What is the difference between a class and an object? An object is a blueprint to make a class A class is a blueprint to make an object Blueprint class is an object make a A blueprint is an object to make a clas | A class is a blueprint to make an object |
| [T / F] Accessor (Getter) – a method that is used to change the data. | False |
| [T / F] final Method: a method that cannot be overridden | True |
| [T / F] this keyword can be passed as argument in the constructor call. | True |
| [T / F] Custom Methods – implement the business rules for which the application is being developed | True |
| [T / F] 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 |
| [T / F] Encapsulation is implemented by using private | True |
| [T / F] In Encapsulation, Class variables can be made read-only or write-only | True |
| [T / F] Encapsulation is the way to add functions in a user defined structure. | False |
| Which feature can be implemented using encapsulation? Inheritance Polymorphism Abstraction Overloading | Abstraction |
| [T / F] In hierarchical inheritance, all the classes involve some kind of inheritance. | False |
| How many types of inheritance can be used at a time in a single program? Any 4 types Any two types Any three types Any type, any number of times | Any type, any number of times |
| Members which are not intended to be inherited are declared as ______ Protected Members Public Members Private Members | Private members |
| Which language doesn't support single level inheritance? All languages support it Kotlin C++ Java | All languages support it |
| If single inheritance is used, program will contain ______ At least 1 class At least 2 classes At least 3 classes | At least 2 classes |
| This model of software development is process-centric or procedural since it concentrates on the procedures in a system A) Object-Oriented Programming (OOP) B) Procedural Programming ✅ C) Functional Programming D) Event-Driven Programming | Procedural Programming |
| It describes the task to be performed on objects. These objects that have to be created and stored in the computer memory, A) Object-Oriented Programming (OOP) B) Procedural Programming C) Functional Programming D) Event-Driven Programming | Object-Oriented Programming |
| It uses a collection of objects interacting with each other. A) Procedural Programming B) Object-Oriented Programming (OOP) C) Functional Programming D) Linear Programming | Object-Oriented Programming |
| Reduced software complexities and realistic modelling through the use of various techniques A) Procedural Programming B) Object-Oriented Programming (OOP) C) Functional Programming D) Linear Programming | Object-Oriented Programming |
| the process of picking out the common features of objects and procedures. This process focuses on the essential characteristics of an object. A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction | Abstraction |
| the process of hiding the implementation details of an object. A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction | Encapsulation |
| allows an object to extend its characteristics to another object. A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction | Inheritance |
| ability to process objects differently depending on their data type or class A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction | Polymorphism |
| A ____ is a template or blueprint that defines an object’s attributes and operations and that is created at design time A) Object B) Method C) Class D) Interface | Class |
| An _____ is a running instance of a class that consumes memory and has a finite lifespan A) Object B) Method C) Class D) Interface | Object |
| Exists when an object contains a reference to another object. A) Encapsulation B) Inheritance C) Aggregation D) Association | Association |
| Referred to as the “kind of” or “is a” relationship. A) Encapsulation B) Inheritance C) Aggregation D) Association | Inheritance |
| The parent class from which properties are inherited by another class Super Class Base Class Sub Class Derived Class | Super Class / Base Class |
| Super Class is also known as? Base Class Sub Class | Base Class |
| A new class with properties taken from a parent class Super Class Base Class Sub Class | Sub Class / Derived Class |
| Sub Class is also known as? Super Class Base Class Sub Class Derived Class | Derived Class |
| a well-encapsulated conceptual class. The objects of this class do not exist in real world Base Class Sub Class Abstract Class | Abstract Class |
| It is used for specifying and visualizing complex software, usually large object-oriented project. It uses several types of diagrams such as the case diagram, class diagram, and state chart diagram A) BPMN B) DFD C) UML | Unified Modeling Language (UML) |
| A ___ is used to describe the attributes and behaviours of objects in the system. A) Interface B) Method C) Class D) Object | Class Diagram |
| Declared either at the start or end of a class definition. These variables identify the data stored in the object. A) Local variables B) Static variables C) Instance variables D) Global variables | Instance Variables/Attributes |
| A method that is automatically executed when an object is created. This method is used to initialize the attributes. A) Destructor B) Static method C) Main method D) Constructor | Constructor |
| Used to change or access the private data in an object A) Constructors B) Static methods C) Standard methods D) Destructor | Standard Methods / Setter Getter Methods |
| A method that is used to change the data Mutator (Setter) Accessor (Getter) | Mutator (Setter) |
| A method that is used to access or retrieve data Mutator (Setter) Accessor (Getter) | Accessor (Getter) |
| Implement the business rules for which the application is being developed. A) Standard methods B) Constructors C) Business logic D) Custom methods | Custom Methods |
| Contains a reference to the current object being constructed. It represents an instance of the class in which it appears. It can be used to access class variables and methods A) super B) self C) this D) new | this |
| Variable: a variable that is only accessible within a class where it is declared. Method: a method that is only accessible within the class where it is declared. | private |
| Variable: a variable that is accessible from all classes. Method: a method that is accessible from all classes. | public |
| The ___ access modifier is accessible within and outside the package but through inheritance only. It can be applied on the data member, method and constructor. It can't be applied on the class. | protected |
| variables stored in each object of a class, usually referred to as the non-static member fields of a class. A) Local variables B) Static variables C) Instance variables D) Global variables | Instance Variables (non-static fields) |
| Stored in the class and are available to all objects of a class or objects of other classes if access is permitted. A) Local variables B) Instance variables C) Class variables D) Global variables | Class Variables (static fields) |
| Data used in a method. This data is temporary and does not exist once the method has completed execution A) Local variables B) Instance variables C) Class variables D) Global variables | Local Variables (method variables or local data) |
| [T / F] it is possible to access private variables if we provide public getter (accessor) and setter (mutator) methods. | True |