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 16:00
If a client wants to make minor edits, what should he/she use?
Answers: 3
question
Computers and Technology, 24.06.2019 12:50
Write a new lc-3 trap subroutine (i.e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i.e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e.g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e.g. b0000 0000 0000 0111 =
Answers: 3
question
Computers and Technology, 25.06.2019 07:50
In addition to the four primary computer operations, today's computers typically also perform functions.
Answers: 1
question
Computers and Technology, 25.06.2019 08:30
Ais a modeling tool used in structured systems analysis and design (ssad) analysis model that break down a complex process into simpler, more manageable, and more understandable subprocesses
Answers: 1
You know the right answer?
1. which of the following statements most accurately describes encapsulation?

a. encaps...
Questions
question
Social Studies, 08.10.2020 04:01
question
Mathematics, 08.10.2020 04:01
question
Biology, 08.10.2020 04:01
Questions on the website: 13722363