ITP100-Chapter 14

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

How would you locate the classes in a particular problem?

1. Identify the nouns, pronouns, and noun phrases in the problem domain description. 2. Eliminate duplicates. 3. Eliminate items of no concern. 4. Eliminate items that represent objects instead of classes. 5. Eliminate simple values that can be stored as variables.

The Class: (CHECK ALL THAT APPLY) is the definition or "blueprint" defines a list of attributes and methods is an example of a data type is an instance of something in memory

1. The Class: (CHECK ALL THAT APPLY) X is the definition or "blueprint" X defines a list of attributes and methods X is an example of a data type is an instance of something in memory

What is a class?

A class is a description of an Object. It is code that specifies the fields and methods (data and procedures) of an object

What is a problem domain description?

A description of the real-world objects, parties and major events related to the problem.

What is an accessor?

A method that gets a value from a class's field but does not change it. Accessors are referred to as getters.

What is a constructor?

A method that is automatically called (executed) when an object is created. Constructors help construct an object usually by initializing an object's fields.

What is a mutator?

A method that stores or changes a value in a class's field. Mutators are referred to as setters.

A module, such as main(), can create many: Classes objects methods

A module, such as main(), can create many: Classes x objects methods

What is a public method?

Access Specifier that can be accessed by code outside the class

What is a private method?

Access Specifier that can only be accessed by code inside the class. They are designed to be accessed internally. Private methods are typically used with a class's fields.

What is the relationship between an object and a class?

Metaphor: Class is a cookie cutter, object is cookie. A class is used to create an object and its contents. An object contains data (fields) and procedures (methods)

What are methods?

Methods are modules or functions of an object.

The key word ________ is used to create the object in memory.

New

What is the purpose of the New keyword?

New creates an object in memory. New is a constructor (in VisualBasic)

What is OOP centered on?

Object-Oriented Programming (OOP) is centered on creating objects

What allows you to create methods with the same name in different classes and gives you the ability to call the correct method depending on the type of object that is used to call it? polymorphism visibility inheritance recursion

What allows you to create methods with the same name in different classes and gives you the ability to call the correct method depending on the type of object that is used to call it? x polymorphism visibility inheritance recursion

What is polymorphism?

Allows you to create methods with the same name in related classes

What is an object?

An Object is a software entity that contains both data and procedures.

An object: (CHECK ALL THAT APPLY) is a variable is created by a constructor is an definition or "blueprint" is an instance of something in memory

An object: (CHECK ALL THAT APPLY) x is a variable x is created by a constructor is an definition or "blueprint" x is an instance of something in memory

What is Information hiding?

Data (information) hiding refers to an object's the ability to hide its data from code that is outside the object.

What is encapsulation?

Encapsulation is the combining of data and code into a single object

If Car is a class, then the corresponding object could be: myToyotaPrius engine model make

If Car is a class, then the corresponding object could be: x myToyotaPrius engine model make

In a UML diagram, what character do you place in front of a field of method name to indicate it is public? + = P - None of these

In a UML diagram, what character do you place in front of a field of method name to indicate it is public? x + = P - None of these

What is inheritance?

Inheritance allows a new class to extend an existing class

Choose the correct method signature for the default constructor of Class Car: void Car() void myCar() Car Car() void new(Car c)

Choose the correct method signature for the default constructor of Class Car: void Car() void myCar() x Car Car() void new(Car c)

What are the three sections of a UML diagram?

Class Name, Fields (attributes), and Methods.

True/False: Declaring a class without the "new" keyword will still allocate in memory all of the space needed for the object. Example: CellPhone myPhone

FALSE

True/False: In an inheritance relationship, the superclass inherits members from the subclass.

FALSE

What is the difference between a superclass and a subclass?

Superclass is a general class and the subclass is a specialized class.

Which is the generalized class and which is the specialized class?

Superclass is a general class and the subclass is a specialized class.

True/False: A constructor generally will initialize all attributes within the object.

TRUE

True/False: Generally, it is good design for the class attributes to be private.

TRUE

True/False: One step in performing Object-Oriented Design is to identify what classes are needed. This can be accomplished by first identifying the nouns of the system.

TRUE

True/False: The default constructor is automatically created for each Class and does not have to be created by the Class author.

TRUE

The ________ are accessor methods. getters or "get methods" setters or "set methods" private members public members

The ________ are accessor methods. x getters or "get methods" setters or "set methods" private members public members

The ________ are mutator methods. getters or "get methods" setters or "set methods" private members public members

The ________ are mutator methods. getters or "get methods" x setters or "set methods" private members public members

The constructor will: create the Class create an object call main() end the program

The constructor will: create the Class x create an object call main() end the program

The name of the constructor is always the same name as the: object Class package file

The name of the constructor is always the same name as the: x object Class package file

What does the "is a" relationship between two objects mean?

The specialized class has all of the characteristics of the generalized class plus additional characteristics that make it special. Like DB one - to - many relationships

What does a subclass inherit from a superclass?

The subclass inherits the members of the superclass. The subclass inherits the fields and methods, except those that are private

The word "private or "public" that appears before an attribute or method name is known as its ________. access specifier or "visibility" data type constructor parameter

The word "private or "public" that appears before an attribute or method name is known as its ________. x access specifier or "visibility" data type constructor parameter

Why is an object's internal data usually hidden from outside code?

To protect the data from accidental corruption. To protect the data from external access (change control)

Two types of class members are ____________ and _____________ objects and classes conditions and non-conditions attributes and methods objects and methods

Two types of class members are ____________ and _____________ objects and classes conditions and non-conditions x attributes and methods objects and methods

What is a UML diagram?

UML = Unified Modeling Language. UML Diagram is a graphic depiction of an object-oriented system

What causes an item of data to become stale?

When the value of an item is dependent on other data but is not updated when the other data is changed, then the item of data has become stale.

Which method is called automatically when an object is created? the getter the setter main the constructor

Which method is called automatically when an object is created? the getter the setter main x the constructor

Which of the following are contained in a UML diagram for a class? Class name Class attributes Class methods All of these None of these

Which of the following are contained in a UML diagram for a class? Class name Class attributes Class methods x All of these None of these

________ allows a new class to extend an existing class. polymorphism visibility inheritance recursion

________ allows a new class to extend an existing class. polymorphism visibility x inheritance recursion

________ is a standard notation used to draw diagrams that describe object-oriented systems. data flow diagrams UML (Unified Modeling Language) flowcharts hierarchy charts

________ is a standard notation used to draw diagrams that describe object-oriented systems. data flow diagrams x UML (Unified Modeling Language) flowcharts hierarchy charts

________ refers to an object's ability to hide its data from code that is outside the object. polymorphism encapsulation inheritance data hiding

________ refers to an object's ability to hide its data from code that is outside the object. polymorphism encapsulation inheritance x data hiding

________ refers to the combining of data and code into a single object. polymorphism encapsulation inheritance data hiding

________ refers to the combining of data and code into a single object. polymorphism x encapsulation inheritance data hiding

Access specifiers

specify the access


Ensembles d'études connexes

Steve Jobs - 02/24/1955 - 10/5/2011

View Set

Networking Technology for Information Professionals Module 2

View Set