This is Java Jeopardy Writing Methods…chapter 4…

Slides:



Advertisements
Similar presentations
Final Jeopardy Question
Advertisements

Topic Topic 2 Topic 3.
This is Java Jeopardy.
Based on Java Software Development, 5th Ed. By Lewis &Loftus
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Module 8 “Polymorphism and Inheritance”. Outline Understanding Inheritance Inheritance Diagrams Constructors in Derived Classes Type Compatibility Polymorphism.
Lecture 2 Basics of C#. Members of a Class A field is a variable of any type that is declared directly in a class. Fields are members of their containing.
CSCI 1100/1202 April 3, Testing A program should be executed multiple times with various input in an attempt to find errors Debugging is the process.
© 2006 Pearson Education Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition by John Lewis,
Chapter 4: Writing Classes
© 2006 Pearson Education Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition by John Lewis,
Inheritance Inheritance Reserved word protected Reserved word super
Road Map Introduction to object oriented programming. Classes
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Chapter 4: Writing Classes Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William Loftus.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
ECE122 L6: Problem Definition and Implementation February 15, 2007 ECE 122 Engineering Problem Solving with Java Lecture 6 Problem Definition and Implementation.
1 Classes, Encapsulation, Methods and Constructors Class definitions Scope of Data –Instance data –Local data The this Reference Encapsulation and Java.
Classes, Encapsulation, Methods and Constructors
Terms and Rules Professor Evan Korth New York University (All rights reserved)
Chapter 4: Writing Classes Presentation slides for Java Software Solutions Foundations of Program Design Third Edition by John Lewis and William Loftus.
Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 Inheritance Inheritance is a fundamental object-oriented design technique used to.
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science by John Lewis, William Loftus, and Cara Cocking Java.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Methods Chapter 6. 2 Program Modules in Java What we call "functions" in C++ are called "methods" in Java Purpose Reuse code Modularize the program This.
Writing Classes (Chapter 4)
Lecture Set 11 Creating and Using Classes Part B – Class Features – Constructors, Methods, Fields, Properties, Shared Data.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
1 Chapter 8 – Classes and Object: A Deeper Look Outline 1 Introduction 2 Implementing a Time Abstract Data Type with a Class 3 Class Scope 4 Controlling.
Chapter 4 -2 part Writing Classes 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design © 2007 Pearson Addison-Wesley. All.
Chapter 4 Writing Classes Part 2. © 2004 Pearson Addison-Wesley. All rights reserved4-2 Classes A class can contain data declarations and method declarations.
Introducing Objects and stuff GABY and MATT Definition: Object: “a class that is the root of the hierarchy tree for all classes in JAVA.” –An object.
8. Inheritance “Is-a” Relationship. Topics Creating Subclasses Overriding Methods Class Hierarchies Abstract Class Inheritance and GUIs The Timer Class.
CSCI 1100/1202 April 1-3, Program Development The creation of software involves four basic activities: –establishing the requirements –creating.
© 2004 Pearson Addison-Wesley. All rights reserved September 14, 2007 Anatomy of a Method ComS 207: Programming I (in Java) Iowa State University, FALL.
Classes. Constructor A constructor is a special method whose purpose is to construct and initialize objects. Constructor name must be the same as the.
Lecture 4 b Writing Classes b class declarations b method declarations b constructors b instance variables b encapsulation b method overloading b program.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Chapter 4: Writing Classes. 2 b We've been using predefined classes. Now we will learn to write our own classes to define new objects b Chapter 4 focuses.
Programming in Java (COP 2250) Lecture 10 Chengyong Yang Fall, 2005.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Classes - Intermediate
AP Java Ch. 4 Review Question 1  Java methods can return only primitive types (int, double, boolean, etc).
5.1 Basics of defining and using classes A review of class and object definitions A class is a template or blueprint for an object A class defines.
1 Chapter 4: Writing Classes  Chapter 4 focuses on: class definitions encapsulation and Java modifiers method declaration, invocation, and parameter passing.
1 Sections 6.4 – 6.5 Methods and Variables Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Java 5 Class Anatomy. User Defined Classes To this point we’ve been using classes that have been defined in the Java standard class library. Creating.
Copyright © 2012 Pearson Education, Inc. Chapter 4 Writing Classes : Review Java Software Solutions Foundations of Program Design Seventh Edition John.
Chapter 4: Writing Classes
Chapter 4: Writing Classes
Haidong Xue Summer 2011, at GSU
Intro To Classes Review
Chapter 3: Using Methods, Classes, and Objects
About the Presentations
Anatomy of a Class & Method
Chapter 4: Writing Classes
Inheritance, Polymorphism, and Interfaces. Oh My
Chapter 4 (part 2).
Outline Writing Classes Copyright © 2012 Pearson Education, Inc.
Group Status Project Status.
Chapter 4 Writing Classes.
Which best describes the relationship between classes and objects?
PreAP Computer Science Quiz Key
Outline Anatomy of a Class Encapsulation Anatomy of a Method
Creating and Using Classes
Chapter 4 Test Review First day
Presentation transcript:

This is Java Jeopardy Writing Methods…chapter 4…

ObjectsMethods Everything Classes Using Classes More Methods Misc To Final Jeopardy

What are methods? This defines an object’s behaviors. BackBack to Board Objects 1

What are attributes? This is the term used to describe the properties of an object’s state of being. BackBack to Board Objects 2

What is aggregation? When an object has other objects as instance data it is said to have this type of relationship. When an object has other objects as instance data it is said to have this type of relationship. BackBack to Board Objects 3

What is association? When an object is aware of and uses another object they are said to have this type of relationship. BackBack to Board Object 4

What is method overloading? This is when we have multiple methods with the same name differentiated by their signatures only. BackBack to Board Method 1

What is a void method? This type of method does not have a return statement. BackBack to Board Method 2

What is method decomposition? This is the process of breaking down a complex method into easier to handle, smaller methods. BackBack to Board Method 3

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. BackBack to Board Method 4

What is scope? This refers to the range in which a variable can be referenced. BackBack to Board Everything Classes 1

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. BackBack to Board Everything Classes 2

What are data declarations and method declarations? These are the members of a class. BackBack to Board Everything Classes 3

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. BackBack to Board Everything Classes 4

What is new? This reserved word is used to create a new instance of a given class. BackBack to Board Using Classes 1

What is a constructor? This is often used to initialize the variables associated with each object. BackBack to Board Using Classes 2

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? BackBack to Board Using Classes 3

What is an instance? When evaluating the relationship between objects and classes, objects are often referred to as this of a class. BackBack to Board Using Classes 4

What are formal parameters? These parameters are located in the header of the method declaration. BackBack to Board More Methods 1

What is method signature? This is the methods name along with the number, type, and order of its parameters. BackBack to Board More Methods 2

What is local data? This type of data can only be used within the method in which it is declared. BackBack to Board More Method 3

What is the method declaration? This defines the code that is executed when the method is invoked. BackBack to Board More Methods 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. BackBack to Board Misc 1

What is encapsulation? This term refers to objects working with other parts of a program only through the objects own methods. BackBack to Board Misc 2

What are visibility modifiers? Public and Private are two examples of this. BackBack to Board Misc 3

What are support methods? Methods that only exist to aid other methods of the class are said to be this type of method. BackBack to Board Misc 4

Final Jeopardy Category Visibility Modifiers make your wagers

Let’s see your answers. Fill in the chart below explaining the impact on ecapsulation. Begin Now. Variable Methods publicprivate

Scrolling methods Public Variables Does not protect data Private Variables Protects Data Public Methods Provides services to clients Private Methods Supports other methods in the class