subject

1. which of the following statements most accurately describes encapsulation?

a. encapsulation combines both procedural and object-oriented programming.

b. encapsulation separates the implementation of a class from how the class is used.

c. encapsulation hides the implementation of a class from the user.

d. encapsulation provides the collection of methods and fields that are accessible from outside the class.

2. a programmer provides you with a class and some documentation describing how its method are used. when you create objects with this class, you will call methods on the object and get results. as a user, your use of this class is separate and distinct from how the code inside the class was implemented. which term best describes the concept at work here?

a. enumeration.

b. encapsulation.

c. subclassing.

d. abstraction.

3. which of the following is not considered an advantage of object-oriented programming?

a. the ability to combine data with methods that operate on the data.

b. the ability to create separate objects, each with its own values.

c. the ability to keep data and operations on the data separate.

d. the ability to prevent access to data through encapsulation.

4. suppose a class has a private instance string variable named name. which of the following blocks of code shows a correct getter method for name?

a. public void getname (string name) {
this. name = name;

b. public int getname( ) {
return name;

c. public string getname ( ) {
return name;

d. public string getname ( ) {
this. name = name;

5. which term best describes a relationship in which an object is owned exclusively by one other object?

a. composition.

b. association.

c. notation.

d. aggregation.

6. which term best describes a relationship in which an object is owned by several other objects?

a. composition.

b. association.

c. notation.

d. aggregation.

7. where are methods listed in a uml class diagram showing three parts?

a. in the top third of the diagram.

b. in the middle third of the diagram.

c. in the bottom third of the diagram.

d. anywhere in the diagram a lowercase m is shown.

8. suppose you have a ulm class diagram that represents a class named student. which of the following notations indicates a constructor?

a. +student (name: string)

b. +student: string

c. +student (name: string): string

d. +student( name: string): void

9. which of the following uml class diagram notations indicates a private array of type int?

a. private int [ ] array;

b. -int [ ] : array

c. -array [ ] : int

d. -array : int [ ]

10. consider the following code.

public class mydata {
private int[ ] data;

public void setdata (int[ ] newarray ) {
data = newarray;
}
public int[ ] getdata( ) {
return data;
}
public int getsize( ) {
return data. length;
}
}

which of the following uml class diagram notations correctly models one of the previous methods?

a. +setdata ( int [ ] newarray ): void

b. +getdata ( int [ ] ) : data

c. -getsize ( ) : int

d. +setdata ( newarray : int [ ] ) : void

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:00, eguzmandpandoracom
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, sunny644
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
image
Computers and Technology, 24.06.2019 12:30, hilario4785
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
image
Computers and Technology, 24.06.2019 16:00, achsahjosey
This isn't about school but every time it tells me to watch an ad to unlock the answer to a question it prompts a survey and it just keeps loading. so i haven't been able to get answers for my tests in like a week.
Answers: 2
You know the right answer?
1. which of the following statements most accurately describes encapsulation?

a. encaps...

Questions in other subjects: