100% found this document useful (1 vote)
974 views

Test: Jfo Section 2 Quiz

This document contains a quiz on object-oriented programming concepts with 5 multiple choice questions and answers. Key points: 1) Question 1 asks to identify methods in a code example, and "displaySalary()" is correctly identified as a method. 2) Question 2 asks about core OO principles, and "Modeling objects" and "Object interaction without a prescribed order" are correctly identified. 3) Question 3 asks if objects can interact by invoking methods, and "True" is the right answer. 4) Question 4 asks about representing a scenario with classes and instances, and "Rose plant is the class and the samples generated from the rose plant are instances of that class" is marked correct.

Uploaded by

UPKM FT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
974 views

Test: Jfo Section 2 Quiz

This document contains a quiz on object-oriented programming concepts with 5 multiple choice questions and answers. Key points: 1) Question 1 asks to identify methods in a code example, and "displaySalary()" is correctly identified as a method. 2) Question 2 asks about core OO principles, and "Modeling objects" and "Object interaction without a prescribed order" are correctly identified. 3) Question 3 asks if objects can interact by invoking methods, and "True" is the right answer. 4) Question 4 asks about representing a scenario with classes and instances, and "Rose plant is the class and the samples generated from the rose plant are instances of that class" is marked correct.

Uploaded by

UPKM FT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

4/25/2021 JFo Section 2 Quiz

Test: JFo Section 2 Quiz


Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Section 2 Quiz
(Answer all questions in this section)

1. In the code example below, identify any methods: Mark for Review

public class Employee { (1) Points


public String name = " Duke";
public int empId = 12105;
public float salary;

public void displaySalary(){


System.out.println("Employee Salary: "+salary);
}
}
name

empId

salary

displaySalary() (*)

Correct

2. In object oriented programming, there is an emphasis on which of the following two: Mark for Review

(1) Points
Creation of procedures.
Writing algorithms.

Modeling objects. (*)


Object interaction without a prescribed order. (*)

Correct

3. An object may interact with another object by invoking methods. Mark for Review

(1) Points
True (*)

False

Correct

4. You have a beautiful garden at home. On Sunday, you start budding your rose plant to make few more Mark for Review
samples of rose plants to plant in the garden. Can you categorize how this scenario could be represented
by classes and instances? (1) Points
Rose plant is the object and samples are not instances of the plant because they have not grown yet.

Rose plant is the class and the samples generated from the rose plant are instances of that class. (*)
Samples of the rose plant are called classes and not the actual rose plant.
Samples are the class and the rose plant is the instances of samples.
https://myacademy.oracle.com/player/play?in_sessionid=28539411210A51AJ&classroom_id=74941470 1/2
4/25/2021
p p p
JFo Section 2 Quiz

Correct

5. There are several fields and methods in a Shirt class. Which of the following could be a method in the Mark for Review
Shirt class?
(1) Points
size
color
getShirtSize() (*)

price

Correct

Page 1 of 3 Next Summary

https://myacademy.oracle.com/player/play?in_sessionid=28539411210A51AJ&classroom_id=74941470 2/2

You might also like