This is Java Jeopardy Writing Methods…chapter 4…

29
This is Java Jeopardy Writing Methods…chapter 4…

Transcript of This is Java Jeopardy Writing Methods…chapter 4…

Page 1: This is Java Jeopardy Writing Methods…chapter 4…

This isJava Jeopardy

WritingMethods…chapter 4…

Page 2: This is Java Jeopardy Writing Methods…chapter 4…

Objects Methods Everything Classes

Using Classes

More Methods Misc.

1 1 1 1 1 1

2 2 2 2 2 2

3 3 3 3 3 3

4 4 4 4 4 4

To Final Jeopardy

Page 3: This is Java Jeopardy Writing Methods…chapter 4…

What are methods?

This defines an object’s behaviors.

Back to BoardObjects 1

Page 4: This is Java Jeopardy Writing Methods…chapter 4…

What are attributes?

This is the term used to describe the properties of an object’s state of being.

Back to BoardObjects 2

Page 5: This is Java Jeopardy Writing Methods…chapter 4…

What is aggregation?

When an object has other objects as instance data it is said to have this type of relationship.

Back to BoardObjects 3

Page 6: This is Java Jeopardy Writing Methods…chapter 4…

What is association?

When an object is aware of and uses another object they are said to have this type of relationship.

Back to BoardObject 4

Page 7: This is Java Jeopardy Writing Methods…chapter 4…

What is method overloading?This is when we have multiple

methods with the same name differentiated by their signatures only.

Back to Board

Method 1

Page 8: This is Java Jeopardy Writing Methods…chapter 4…

What is a void method?

This type of method does not have a return statement.

Back to BoardMethod 2

Page 9: This is Java Jeopardy Writing Methods…chapter 4…

What is method decomposition?This is the process of breaking down

a complex method into easier to handle, smaller methods.

Back to BoardMethod 3

Page 10: This is Java Jeopardy Writing Methods…chapter 4…

What is parameter list?

When methods are created this follows the method name explaining the type of values that can be passed to the method and their names.

Back to BoardMethod 4

Page 11: This is Java Jeopardy Writing Methods…chapter 4…

What is scope?

This refers to the range in which a variable can be referenced.

Back to BoardEverything Classes 1

Page 12: This is Java Jeopardy Writing Methods…chapter 4…

What is private visibility?

This type of visibility protects instance data by requiring programmers to interact with an object’s method to change the object’s state.

Back to BoardEverything Classes 2

Page 13: This is Java Jeopardy Writing Methods…chapter 4…

What are data declarations and method declarations? These are the members of a class.

Back to Board

Everything Classes 3

Page 14: This is Java Jeopardy Writing Methods…chapter 4…

What is public visibility?

In order for a programmer to interact with protected objects created in our classes, methods we have created should be declared with this type of visibility.

Back to Board

Everything Classes 4

Page 15: This is Java Jeopardy Writing Methods…chapter 4…

What is new?

This reserved word is used to create a new instance of a given class.

Back to BoardUsing Classes 1

Page 16: This is Java Jeopardy Writing Methods…chapter 4…

What is a constructor?

This is often used to initialize the variables associated with each object.

Back to BoardUsing Classes 2

Page 17: This is Java Jeopardy Writing Methods…chapter 4…

What are actual parameters? When using methods from a class you

have created you pass these parameters into the method declaration within the class you created?

Back to BoardUsing Classes 3

Page 18: This is Java Jeopardy Writing Methods…chapter 4…

What is an instance?

When evaluating the relationship between objects and classes, objects are often referred to as this of a class.

Back to BoardUsing Classes 4

Page 19: This is Java Jeopardy Writing Methods…chapter 4…

What are formal parameters?

These parameters are located in the header of the method declaration.

Back to Board

More Methods 1

Page 20: This is Java Jeopardy Writing Methods…chapter 4…

What is method signature?

This is the methods name along with the number, type, and order of its parameters.

Back to BoardMore Methods 2

Page 21: This is Java Jeopardy Writing Methods…chapter 4…

What is local data?

This type of data can only be used within the method in which it is declared.

Back to BoardMore Method 3

Page 22: This is Java Jeopardy Writing Methods…chapter 4…

What is the method declaration? This defines the code that is executed

when the method is invoked.

Back to BoardMore Methods 4

Page 23: This is Java Jeopardy Writing Methods…chapter 4…

What is instance data?

Attributes, such as the variable face in the coin class, are considered this type of data because memory space is created for each instance of the class that is created.

Back to BoardMisc 1

Page 24: This is Java Jeopardy Writing Methods…chapter 4…

What is encapsulation?

This term refers to objects working with other parts of a program only through the objects own methods.

Back to BoardMisc 2

Page 25: This is Java Jeopardy Writing Methods…chapter 4…

What are visibility modifiers? Public and Private are two examples of

this.

Back to BoardMisc 3

Page 26: This is Java Jeopardy Writing Methods…chapter 4…

What are support methods?

Methods that only exist to aid other methods of the class are said to be this type of method.

Back to BoardMisc 4

Page 27: This is Java Jeopardy Writing Methods…chapter 4…

Final Jeopardy Category

Visibility Modifiers

make your wagers

Page 28: This is Java Jeopardy Writing Methods…chapter 4…

Let’s see your answers.

Fill in the chart below explaining the impact on ecapsulation.

Begin Now.

Variable

Methods

public private

Page 29: This is Java Jeopardy Writing Methods…chapter 4…

Scrolling methods

Public VariablesDoes not protect data

Private VariablesProtects Data

Public MethodsProvides services to clients

Private MethodsSupports other methods in the class