Do you know that? 2500+ skills sought by businesses on oDesk next

Contact Email:

<< All Upwork (oDesk) and Elance Tests << Elance test answers << IT & Programming category

Test answers for OOPS Concepts 2020

(61) Last updated: January 27
Elance • IT & Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:

Collapse | Expand

61 Answered Test Questions:

1. What is a primary motivation for using OOP?


• To increase data coupling.

• Because other programming paradigms have become obsolete.

• To increase reusability and maintainability of code.

• To increase speed of writing code.

2. Why is dynamic binding referred to as “late binding”?


• It is never bound.

• It is bound at compile time.

• It is not bound at compile time.

• It is not bound at runtime.

3. A mutator method is also known as a:


• getter

• setter

• updater

• deleter

4. True or false? Polymorphism means to support multiple inheritance.


• True

• False

5. Which of the following could be considered a polymorphism?


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

• Two classes named “add”.

• Two functions named “clsCalculation”.

• Two classes named “clsCalculation” with the single function, “add”.

6. What is the most important trait of a polymorphism?


• The common interface.

• The multiple interfaces.

• The difference in interface.

• The total differences.

7. A trait is:


• a collection of methods

• another word for class

• another word for interface

8. Why is composition considered a simpler method than inheritance?


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

• It isn't considered a simpler method.

• It is filled with complicated inheritance hierarchies.

• Composition has complex namespace clashes.

9. Can an object have more than one instance?


• Yes, but it will result in errors.

• Yes, but they must be in two different physical locations.

• Yes.

• No.

10. Ref counts are:


• a way of managing object lifetimes

• magic methods on all classes

• how wrestling referees determine a winner

• an optimization for compilers

11. 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.


• False

• only if $count is static in both uses

• True

12. What are objects identified by?


• Their orientation within a program.

• Their qualities.

• Their relationship with other objects.

• Their unique name.

13. In most OOP languages virtual methods are:


• not callable directly

• statically dispatched

• dynamically dispatched

14. What is another name for the composition over inheritance technique?


• Constant Refurbishment Practices

• Composite Reuse Principle

• Comcast Reuse Principle

• Compost Reuse Principle

15. What kind of relationship is the public class “Animal” with the extension, “Mammal” demonstrating?


• WAS-A Relationship

• IS-NOT-A Relationship

• IS-A Relationship

• HAS-A Relationship

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


• False

• True

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


• The compiler would compile them separately in different instances, thus resolving any errors.

• The compiler would ignore both of them.

• The compiler would assume a meaning and compile automatically.

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

18. Static binding is also known as what?


• Runtime binding.

• Late binding.

• Early binding.

• Dynamic binding.

19. When does binding occur with static binding?


• Never.

• After runtime binding occurs.

• At runtime.

• At compile time.

20. The diamond problem refers to:


• a common problem in single inheritance hierarchies

• a standard interview question for programmers

• a very hard computer program, refering to the Mohs scale

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

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


• The private methods.

• All of the code in the program.

• The Java console.

• The public methods.

22. True or false? the final keyword blocks a child class from altering a method.


• True

• False

23. Which of the following classes allows only one object of it to be created?


• Friend class

• Abstract class

• Virtual class

• Singleton class

24. True or false? .Encapsulation is a key reason to choose OOP design


• False

• True

25. Dynamic binding refers to binding that is done when?


• At both compile time, and runtime.

• At runtime only.

• At night.

• At compile time.

26. If a variable is declared to be default, what kind of modifier does it have?


• Alphabetical.

• Truncated.

• Numeric.

• It has no modifiers.

27. True or false? An interface is another name for a class.


• True

• False

28. Patterns are:


• solved computer science problems that are easy to reuse

• unpredictable

• another word for interfaces

• for weenies and should be avoided

29. When an object is instantiated:


• it gets a static initialization

• the new method is called

• the constructor method is called

• the init method is called

30. How can dynamic binding be contrasted with static binding?


• Static binding is better than dynamic binding.

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

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

• They are bound together with polymorphic compiling.

31. True or false? Implementing an interface is the same as creating a subclass


• True

• False

32. A polymorphism can be called what?


• The order of objects in a sequence.

• A relationship between two objects.

• Functions that perform the same way.

• A function that performs in different ways.

33. True or false? Private methods can be called by subclasses


• True

• False

34. If you wanted a variable to be free from changes outside its class, how should it be declared?


• Encapsulated.

• Private.

• Free.

• Public.

35. What is encapsulation used for?


• Encapsulation is used to isolate malicious code.

• Encapsulation is used to hide programmers from code.

• Encapsulation is used to prevent unauthorized access to code.

• Encapsulation is used to hide code from programmers.

36. Static functions can use which variables?


• public

• private and static

• static

• private

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


• False

• True

38. What is a simple way to think of inheritance?


• One object acquiring the properties of another.

• New properties written from scratch.

• One object generating another object.

• One object writing new properties for another.

39. Which of these concepts is not an OOP concept?


• encapsulation

• semantics

• decoupling

• inheritance

40. What are method names typically restricted by?


• Grammatical rules.

• Ethical rules.

• The alphabet.

• Code conventions.

41. Public variables are visible outside of the class.


• only through methods

• True

• False

• only to subclasses

42. C is an object oriented language


• False

• True

43. True or false? A class can implement one or more interfaces.


• False

• True

44. C++ is an object oriented language


• True

• False

45. OOP stands for:


• object oriented programming

• objectively oriented programmers

• oops!

• oblong object programming

46. When a variable is defined within a class, what is it considered?


• An early variable.

• An instance variable.

• A class variable.

• A varying variable.

47. Which of the following is included in the field of formal semantics?


• The comprehension of relational models.

• The understanding of programming models.

• The definition of semantic models.

• The definition of logistic models.

48. Lambda functions are allowed in class definitions


• True

• False

49. True or false? Static variables are visible outside of the class


• False

• True

• depends

50. An abstract class can:


• Be subclassed

• Only contain abstract methods

• Be instantiated

51. Semantically, what has happened if the result rendered is non-computational?


• A system failure.

• Syntactically illegal strings have occurred.

• A program corruption.

• Syntactically legal strings have occurred.

52. True or false? Abstract methods are only defined in the parent.


• False

• True

53. When two methods have the same name, what are they considered, and what kind of binding do they have?


• Overloaded, late.

• Overhauled, static.

• Overloaded, dynamic.

• Overloaded, static.

54. A clone method is needed to:


• make any copies of this object

• make any copies of the parent object

• to create a second copy of all contained subobjects

• make any copies of children objects

55. Programming languages supporting the OOPS paradigm are typically contained within what two classes?


• OOPS-based and object-based

• Prototype-based, or class-based.

• Logic-based and inference-based.

• System based and program-based.

56. What are classes used for?


• Classes are used to define specific types.

• Classes are used to manage metadata.

• Classes describe different features.

• Classes define objects.

57. What class and extension best demonstrate a HAS-A Relationship?


• Feline, Canine

• Feline, Animal

• Feline, Lion

• Canine, Mammal

58. Virtual inheritance is:


• where only one base class object is created

• the base class is replicated for each derived class

• where virtually nothing is inherited

• not an OOP term

59. True or false? Private variables are visible outside of the class.


• only through methods

• only to subclasses

• False

• True

60. If a system is systematically computing “metadata”, what would you use to define that system?


• Accentuated grammars.

• Attribute phonetics.

• Attribute grammars.

• Programming metadata.

61. What plays a critical role in testing for syntactic legality?


• Syntactic congruency.

• Termination proofs.

• Logical assumptions.

• Mathematical truths.