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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is used to analyze and summarize your data without graphical support
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
You know the right answer?
1. which of the following statements most accurately describes encapsulation?

a. encaps...
Questions
question
Mathematics, 04.07.2019 00:00
Questions on the website: 13722367