Computer Knowledge

Object-Oriented Programming

2,686 Questions

Object-oriented programming questions test core computer science concepts like classes, inheritance, polymorphism, and encapsulation. The focus includes Java program structures, method overloading, and memory allocation for objects. This topic is essential for technical sections in various recruitment tests.

Java class definitionsMethod overriding rulesPolymorphism conceptsGeneric type parametersMemory allocation in objects

Object-Oriented Programming Questions

Multiple choice technology web technology
  1. Same ClassGroup

  2. Same AccessGroup

  3. Same WorkPool

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Pega's covering mechanism, both the cover work object and covered work objects must belong to the same ClassGroup. This ensures structural consistency and proper inheritance relationships. AccessGroups control security, WorkPools manage assignment routing, but ClassGroup membership is the requirement for covering.

Multiple choice technology web technology
  1. Pattern Inheritance

  2. Direct Inheritance

  3. Both

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Pega, every class must specify a direct parent class through Direct Inheritance, which is mandatory. Pattern Inheritance is optional and uses naming patterns to find parents automatically. Therefore Direct Inheritance is the required component.

Multiple choice technology web technology
  1. Mico-Finance

  2. Finance-

  3. Mico-Finance-

  4. All of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Pattern Inheritance works by removing trailing characters (hyphens, numbers) from class names to find parent classes. For 'MICO-Finance-', removing the trailing hyphen gives 'MICO-Finance'. The dash is part of the pattern, not the base name.

Multiple choice technology web technology
  1. a) PegaRP-Work-Object-Admin-

  2. b) PegaRP-Data-ProductArea

  3. c) PegaRP-Work-Object-Admin

  4. d) PegaRP-Work-Project

  5. e) All of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Pega, abstract classes cannot create work objects and end with a hyphen. 'PegaRP-Work-Object-Admin-' ends with a hyphen, indicating it's abstract. 'PegaRP-Work-Object-Admin' and others without hyphens are concrete classes that can create instances.

Multiple choice technology web technology
  1. a) I, II, IV, III, V, VII, VI, VIII

  2. b) I, IV, V, VI, VII, VIII, II, III

  3. c) I, IV, II, V, VII, III, VI, VIII

  4. d) I, II, IV, V, VII, III, VI, VIII

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The correct sequence starts with the base, then creates Work classes hierarchically (IV→V→VI→VII→VIII) before Data classes (II→III). This establishes the work structure first, then data structures. Option B follows this pattern correctly.

Multiple choice technology web technology
  1. (a) px

  2. (b) py

  3. (c) A and B

  4. (d) Pz

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Pega properties with the pz prefix (Pz, D) are personalized properties explicitly intended for modification by end users. Properties with px (A) are protected system properties that cannot be modified. Properties with py (B) are internal properties used by the Pega platform. The pz designation allows safe customization without affecting system behavior.

Multiple choice technology web technology
  1. (a) Data-Operator-Party

  2. (b) Data-Party-Operator

  3. (c) Party-Data-Operator

  4. (d) Party-Operator-Data

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The standard Pega class for representing an 'Originator' party is Data-Party-Operator (B). This follows Pega's naming convention where the class structure is Data-[Purpose]-[Entity]. The options A (Data-Operator-Party), C (Party-Data-Operator), and D (Party-Operator-Data) do not follow the correct class naming pattern.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The statement is false. PRPC's class structure and inheritance hierarchy already handle repeating groups effectively through embedded properties and page lists. You do NOT need to design additional classes to represent repeating groups - the platform provides built-in mechanisms for this.

Multiple choice technology web technology
  1. (a) Citi-, Rule-, HTML-

  2. b. Work-, Data-, and History-

  3. c. Class-, Property-, Method-

  4. (d) none of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In PRPC, all custom classes inherit from three base classes: Work- (for work/case objects), Data- (for data/reference objects), and History- (for historical records). These provide the fundamental inheritance structure for the PRPC class hierarchy.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The statement is false - you should create properties for higher-level classes before lower-level classes in Pega's class hierarchy. This top-down approach ensures that inheritance works properly, as lower-level classes (subclasses) inherit properties and behaviors from their higher-level parent classes. Creating parent class properties first provides the foundation for child classes to extend.

Multiple choice technology web technology
  1. Same ClassGroup

  2. Same AccessGroup

  3. Same WorkPool

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Pega PRPC, cover and covered objects must belong to the same ClassGroup to maintain proper inheritance and data organization. This ensures that related work objects are grouped together correctly within the class hierarchy, which is fundamental to Pega's data model.

Multiple choice technology web technology
  1. Parent Class only

  2. Parent class and all its child classes

  3. Parent class and all its child classes unless explicitly overridden by another access rule

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Pega PRPC's access control model, when an access role is specified on a parent class, it applies to that parent and all its child classes by default. However, this inheritance can be explicitly overridden by defining a more specific access rule on a child class. This provides flexible, hierarchical permission management.

Multiple choice technology web technology
  1. Mico-Finance

  2. Finance-

  3. Mico-Finance-

  4. All of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Pega's Pattern Inheritance finds the parent class by removing pattern elements from the right. For 'MICO-Finance-', it first removes trailing special characters like '-' to find 'MICO-Finance', then looks for that class. Option A is correct because Pattern Inheritance strips the trailing dash. Option B lacks the prefix, and Option C still has the trailing dash which would be stripped in the next iteration.