Tuesday, December 15, 2015

OOPS Concepts test answers of 2016.

In this post you can find Complete and recently updated Correct Question and answers of OOPS Concepts. All Answers updated regularly with new questions. Upwork OOPS Concepts test answers of 2016.



Question:* What is a primary motivation for using OOP?

Answer: • To increase reusability and maintainability of code.

Question:* Why is dynamic binding referred to as “late binding”?

Answer: • It is not bound at compile time.

Question:* A mutator method is also known as a:

Answer: • setter

Question:* True or false? Polymorphism means to support multiple inheritance.

Answer: • False

Question:* Which of the following could be considered a polymorphism?

Answer: • The class, “clsCalculation” with two functions, both named “Add”.

Question:* What is the most important trait of a polymorphism?

Answer: • The common interface.

Question:* A trait is:

Answer: • a collection of methods

Question:* Why is composition considered a simpler method than inheritance?

Answer: • Composition lacks the namespace clash, and the complicated inheritance hierarchies.

Question:* Can an object have more than one instance?

Answer: • Yes.

Question:* Ref counts are:

Answer: • a way of managing object lifetimes

Question:* True or false? It's legal to have two variables both named $count where one is a global variable and the other is used inside a class.

Answer: • True

Question:* What are objects identified by?

Answer: • Their unique name.

Question:* In most OOP languages virtual methods are:

Answer: • dynamically dispatched

Question:* What is another name for the composition over inheritance technique?

Answer: • Composite Reuse Principle

Question:* What kind of relationship is the public class “Animal” with the extension, “Mammal” demonstrating?

Answer: • IS-A Relationship

Question:* True or false? Using traits gives single inheritance languages most of the power of multiple inheritance.

Answer: • True

Question:* If you wrote two methods with the same syntax and arguments to define a class, what would happen?

Answer: • An error because the compiler can't tell them apart.

Question:* Static binding is also known as what?

Answer: • Early binding.

Question:* When does binding occur with static binding?

Answer: • At compile time.

Question:* The diamond problem refers to:

Answer: • the multiple inheritance issue of determining which subclass method to call

Question:* If a user were to observe Java code from the outside world, what would they be able to access?

Answer: • The public methods.

Question:* True or false? the final keyword blocks a child class from altering a method.

Answer: • True

Question:* Which of the following classes allows only one object of it to be created?

Answer: • Singleton class

Question:* True or false? .Encapsulation is a key reason to choose OOP design

Answer: • True

Question:* Dynamic binding refers to binding that is done when?

Answer: • At runtime only.

Question:* If a variable is declared to be default, what kind of modifier does it have?

Answer: • It has no modifiers.

Question:* True or false? An interface is another name for a class.

Answer: • False

Question:* Patterns are:

Answer: • solved computer science problems that are easy to reuse

Question:* When an object is instantiated:

Answer: • the constructor method is called

Question:* How can dynamic binding be contrasted with static binding?

Answer: • Dynamic binding is runtime binding, while static binding is compile time binding.

Question:* True or false? Implementing an interface is the same as creating a subclass

Answer: • False

Question:* A polymorphism can be called what?

Answer: • A function that performs in different ways.

Question:* True or false? Private methods can be called by subclasses

Answer: • False

Question:* If you wanted a variable to be free from changes outside its class, how should it be declared?

Answer: • Private.

Question:* What is encapsulation used for?

Answer: • Encapsulation is used to prevent unauthorized access to code.

Question:* Static functions can use which variables?

Answer: • static

Question:* True or false? A class factory and a constructor are the exact same thing.

Answer: • False

Question:* What is a simple way to think of inheritance?

Answer: • One object acquiring the properties of another.

Question:* Which of these concepts is not an OOP concept?

Answer: • semantics

Question:* What are method names typically restricted by?

Answer: • Code conventions.

Question:* Public variables are visible outside of the class.

Answer: • True

Question:* C is an object oriented language

Answer: • False

Question:* True or false? A class can implement one or more interfaces.

Answer: • True

Question:* C++ is an object oriented language

Answer: • True

Question:* OOP stands for:

Answer: • object oriented programming

Question:* When a variable is defined within a class, what is it considered?

Answer: • An instance variable.

Question:* Which of the following is included in the field of formal semantics?

Answer: • The definition of semantic models.

Question:* Lambda functions are allowed in class definitions

Answer: • False

Question:* True or false? Static variables are visible outside of the class

Answer: • depends

Question:* An abstract class can:

Answer: • Be subclassed

Question:* Semantically, what has happened if the result rendered is non-computational?

Answer: • Syntactically illegal strings have occurred.

Question:* True or false? Abstract methods are only defined in the parent.

Answer: • False

Question:* When two methods have the same name, what are they considered, and what kind of binding do they have?

Answer: • Overloaded, static.

Question:* A clone method is needed to:

Answer: • to create a second copy of all contained subobjects

Question:* Programming languages supporting the OOPS paradigm are typically contained within what two classes?

Answer: • Prototype-based, or class-based.

Question:* What are classes used for?

Answer: • Classes are used to define specific types.

Question:* What class and extension best demonstrate a HAS-A Relationship?

Answer: • Feline, Lion

Question:* Virtual inheritance is:

Answer: • where only one base class object is created

Question:* True or false? Private variables are visible outside of the class.

Answer: • only through methods

Question:* If a system is systematically computing “metadata”, what would you use to define that system?

Answer: • Attribute grammars.

Question:* What plays a critical role in testing for syntactic legality?

Answer: • Termination proofs.



No comments:

HTML5 Upwork (oDesk) TEST ANSWERS 2022

HTML5 Upwork (oDesk) TEST ANSWERS 2022 Question: Which of the following is the best method to detect HTML5 Canvas support in web br...

Disqus for upwork test answers