Which best describes the relationship between classes and objects?

Slides:



Advertisements
Similar presentations
PHP functions What are Functions? A function structure:
Advertisements

JAVA Revision Lecture Electronic Voting System Marina De Vos.
This is Java Jeopardy Writing Methods…chapter 4…
Week 8 Recap CSE 115 Spring Composite Revisited Once we create a composite object, it can itself refer to composites. Once we create a composite.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Syntax & terminology review While the following slides are not exactly what we did on the board (object diagrams are not shown here) they cover most of.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE 115/503 Introduction to Computer Science for Majors I1 Example Dog fido = new Dog(new Collar()); Dog rover = new Dog(new Collar()); rover.setCollar(fido.getCollar());
Fall 2007CSE 115/503 Introduction to Computer Science for Majors I1 Now What? What if we want to talk to something that was created somewhere else? E.g.
1 Composition A whole-part relationship (e.g. Dog-Tail) Whole and part objects have same lifetime –Whole creates instance of part in its constructor In.
Week 4 Recap CSE 115 Spring Formal Parameter Lists Comma-separated list of formal parameters Formal parameters are listed giving the type of the.
Class template Describing a generic class Instantiating classes that are type- specific version of this generic class Also are called parameterized types.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Fall 2005CSE 115/503 Introduction to Computer Science I1 Association Also called “knows a”. A relationship of knowing (e.g. Dog-Collar as opposed to Dog-Tail)
Week 5 Recap CSE 115 Spring Composition Informally called “has a” Represented in UML with a diamond- headed arc In code: Declare an instance variable.
CSE 115 Week 4 February 4 - 8, Monday Announcements Software installation fest Tuesday & Wednesday 4-7 in Baldy 21. Software installation fest Tuesday.
Fall 2007CSE 115/503 Introduction to Computer Science for Majors I1 Announcements Attendance sheet is going around – be sure you sign it! First part of.
Week 3 Recap CSE 115 – Spring Constructor Special capability of a class that sets up the initial state of the object. Constructor definitions are.
Inheritance Review/Recap. ClassA extends ClassB ClassA now inherits (can access and use) all public and protected elements of ClassB We can expect the.
OOPDA Review. Terminology class-A template defining state and behavior class-A template defining state and behavior object-An instance of a class object-An.
Fall 2005CSE 115/503 Introduction to Computer Science I1 Composition details Recall, composition involves 3 things: –Declaration of instance variable of.
Object Orientation An Object oriented approach views systems and programs as a collection of interacting objects. An object is a thing in a computer system.
Chapter 5 - Writing a Problem Domain Class Definition1 Chapter 5 Writing a Problem Domain Class Definition.
1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a.
For Wednesday No new reading Complete WebCT quiz.
Chapter 10 Classes and Objects: A Deeper Look Visual C# 2010 for Programmers © by Pearson Education, Inc. All Rights Reserved.
Environment Change Information Request Change Definition has subtype of Business Case based upon ConceptPopulation Gives context for Statistical Program.
ECE122 Feb. 22, Any question on Vehicle sample code?
Designing a Card Game Solitaire--Thirteens. Game.
Chapter 10 Classes and Objects In-Depth. Chapter 10 A class provides the foundation for creating specific objects, each of which shares the general attributes,
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
Inheritance Objectives: Creating new classes from existing classes The protected modifier Creating class hierarchies Abstract classes Indirect visibility.
Lec 14 Writing an Instantiable Class III. Agenda Review of Instantiable Classes Scope of variables Using this to override scope issues Lab: Creating a.
AP Computer Science A – Healdsburg High School 1 Unit 9 - Why Use Classes - Anatomy of a Class.
ACM/JETT Workshop - August 4-5, : Defining Classes in Java.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 27 I Love this Class.
Inheritance and Polymorphism. Superclass and Subclass Inheritance defines a relationship between objects that share characteristics. It is a mechanism.
Chapter 9 Life & Death of an Object Stacks & Heaps; Constructors Garbage Collector (gc)
Erosion of pyramids With variable uplift and hardness Daniel Clements.
Objective: Learn to describe the relationships and extend the terms in arithmetic sequence.
10. MORE OBJECTS Rocky K. C. Chang October 18, 2015 (Based on from Charles Dierbach. Introduction to Computer Science Using Python and adapted from John.
Lecture 3: More on Classes Textbook: Chapter 2 Recap: –Classes vs. Objects –Q: What comes first a class or an object? –Q: Do we need a class to create.
INTRODUCTION TO CLASSES & OBJECTS CREATING CLASSES USING C#
2.4 Exceptions n Detects try { //code that may raise an exception and/or set some condition if (condition) throw exceptionName; //Freq. A string } n Handles.
Class Inheritance Part I
Objects as a programming concept
Objects as a programming concept
Haidong Xue Summer 2011, at GSU
Interface, Subclass, and Abstract Class Review
Objects as a programming concept
Intro To Classes Review
PHP Classes and Objects
Using local variable without initialization is an error.
Chapter 10 Thinking in Objects
Can perform actions and provide communication
Inheritance, Polymorphism, and Interfaces. Oh My
Chapter 4 (part 2).
Class 7 coordinates: pixel and with setCoords aspect ratio Rectangle
  Introduction  What the generic.  What are the Generic types : - Class - Methods   Type of coding the generic method. - Using the generic method.
Notes from Week 5 CSE 115 Spring 2006 February 13, 15 & 17, 2006.
1.4 ทบทวน JAVA OO Programming Concepts Declaring and Creating Objects
February , 2009 CSE 113 B.
Chapter 4 Constructors Section 4.4
Relationship among variables
U12-6 Unit 12 Warm-Up – 05/01 Write the equation for the Combined Gas Law. What variable is held constant when using this law? Rearrange the Combined Gas.
Unit-2 Objects and Classes
Classes and Objects CGS3416 Spring 2019.
Relationship among variables
Chapter 4 Test Review First day
Presentation transcript:

Which best describes the relationship between classes and objects? Classes and objects are the same Objects are instances of classes Classes are instances of objects

Consider this code: What is GraphWin? A class An object A variable w = GraphWin('Hi there', 100,200) What is GraphWin? A class An object A variable A parameter A call to a constructor

Consider this code: What is 100? An object A variable A parameter w = GraphWin('Hi there',100,200) What is 100? An object A variable A parameter A call to a constructor

What is GraphWin('Hi there', 100,200) ? An object A variable Consider this code: w = GraphWin('Hi there', 100,200) What is GraphWin('Hi there', 100,200) ? An object A variable A reference to an object A call to a constructor

Consider this code: What is w? An object A variable w = GraphWin('Hi there', 100,200) What is w? An object A variable A name for an object A and B A and C B and C A, B, and C