CSE 115 Week 2 January 21 - 25, 2008. Wednesday Announcements Pick up Syllabus if you need one Pick up Syllabus if you need one Recitation Change Form.

Slides:



Advertisements
Similar presentations
•7/12 /07 F-1 © 2010 T. Horton CS 4240 Principles of SW Design Packages in Java and UML.
Advertisements

CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 2 Getting Started with Java Program development.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Introduction to Computer Programming I CSE 113
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Lecture #5 Agenda Cell phones off & name signs out Review Questions? UML class diagram introduction Our first class definition!
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Java Syntax, Java Conventions, CSE 115 Conventions (Part 1) CSE 115 Spring 2006 January 25 & 27, 2006.
Introduction To Computers and Programming Lecture 2: Your first program Professor: Evan Korth New York University.
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
CSE 115 Week 5 February , Monday Announcements Exam 3 today Exam 3 today Lab 3 due this week Lab 3 due this week Exam 4 Monday 2/18 Exam.
Week 4 Recap CSE 115 Spring Formal Parameter Lists Comma-separated list of formal parameters Formal parameters are listed giving the type of the.
Where do objects come from? Objects are instances of classes We instantiate classes: –e.g.new chapter1.Terrarium() –There are three parts to this expression:
CSE 250: Data Structures Week 2 January 21 – 25, 2008.
CSE 113 Week 3 January 28 – February 1, Monday Announcements  Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Bring your laptop or.
Lecture #4 Agenda Cell phones off & name signs out Review Questions? Objects The birds-and-the-bees talk.
Week 2 Recap CSE 115 – Spring Object Oriented Program System of objects that communicate with one another to solve some problem.
Week 4 Recap CSE 115 Fall 2006 Section C. Decoupling Separation of concerns Defining what an object can do, not how it does it.
Fall 2005CSE 115/503 Introduction to Computer Science I1 Lecture #4 Agenda Announcements Review Questions? Classes and objects UML class diagrams Creating.
Java Syntax, Java Conventions, CSE 115 Conventions (Part 2) CSE 115 Spring 2006 January 30, February 1 & 3, 2006.
What is a class? a class definition is a blueprint to build objects its like you use the blueprint for a house to build many houses in the same way you.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
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 3 January 28 – February 1, Monday Announcements Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Software Installation.
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
CSE 115 Week 4 February 4 - 8, Monday Announcements Software installation fest Tuesday & Wednesday 4-7 in Baldy 21. Software installation fest Tuesday.
CSE 250: Data Structures Week 3 January 28 – February 1, 2008.
Fall 2007CSE 115/503 Introduction to Computer Science for Majors I1 End of Week Five! Questions? First part of essay assignment (choosing a topic) is posted.
Week 3 Recap CSE 115 – Spring Constructor Special capability of a class that sets up the initial state of the object. Constructor definitions are.
Week 3 Recap CSE 115 – Fall Java Source Code File Made up of: Package declaration Class definition.
UML class diagrams (1) UML = Unified Modeling Language We use only class diagrams, not other UML diagrams Purpose: –keep OO concepts separate from implementation.
CSE 250: Data Structures Week 1 January , 2008.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
You gotta be cool. Introduction to Classes, Objects and Strings Introduction Defining a Class with a Member Function Defining a Member Function with a.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
CSC 142 B 1 CSC 142 Java objects: a first view [Reading: chapters 1 & 2]
CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall 1.
Computer Science 119 Intro to Java 9/24 and 9/25.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall
The Java Programming Language
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
4/1/05F-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Packages and Components in Java and UML.
Introduction to programming in the Java programming language.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall
February 2 - 6,  2/4: Go over review sheet for Exam 1  2/6: Exam 1 & Lab 1 due  2/9: Go over Exam 1  2/11: Makeup exam for Exam 1.
1 Chapter 5: Defining Classes. 2 Basics of Classes An object is a member of a class type What is a class? Fields & Methods Types of variables: –Instance:
Wednesday, January 7, 2015 Learning Target: I can identify a goal for the coming semester and compile ways to reach that goal. Today’s Activities: Semester.
CS 106 Introduction to Computer Science I 01 / 22 / 2008 Instructor: Michael Eckmann.
SUMMARY OF CHAPTER 2: JAVA FUNDAMENTS STARTING OUT WITH JAVA: OBJECTS Parts of a Java Program.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Chapter 3 Introduction to Classes, Objects Methods and Strings
3 Introduction to Classes and Objects.
Chapter 3 Introduction to Classes, Objects Methods and Strings
Chapter 3 Introduction to Classes, Objects Methods and Strings
Basic C++ What’s a declaration? What’s a definition?
Collections & Definite Loops
CSE 115 September 29 – October 3, 2008.
CSE 115 September 29 – October 3, 2008.
Documentation and Style
Object Oriented Programming in java
February , 2009 CSE 113 B.
CSc 2310 Principles of Programming (Java)
February 2 - 6, 2009 CSE 113 B.
Presentation transcript:

CSE 115 Week 2 January , 2008

Wednesday Announcements Pick up Syllabus if you need one Pick up Syllabus if you need one Recitation Change Form Recitation Change Form Lab 1 Prep Work Lab 1 Prep Work Communications Assignment Sign Up Sheet (DUE TODAY) Communications Assignment Sign Up Sheet (DUE TODAY) –There are no papers available in any section, don’t even bother putting down a paper choice.

Wednesday Game Plan Collect Communications Assignment Collect Communications Assignment Objects vs. Classes Objects vs. Classes Creating objects in Eclipse using Dr. Java Creating objects in Eclipse using Dr. Java Creating Source Code Files Creating Source Code Files

Wednesday UML diagram show classes UML diagram show classes First section gives class name First section gives class name Second section tells us the properties Second section tells us the properties Third section tells us the capabilities Third section tells us the capabilities

Wednesday new chapter1.Terrarium(); new chapter1.Terrarium(); Operator that tells Java we want a new instance created Operator that tells Java we want a new instance created This class lives in a package called chapter1 This class lives in a package called chapter1 Name of the class we are trying to create an instance of Name of the class we are trying to create an instance of

Wednesday Packages are ways to organize our class definitions. Each package must be a directory on the file system. Packages are ways to organize our class definitions. Each package must be a directory on the file system. All of our classes this semester will be defined in a package. All of our classes this semester will be defined in a package.

Wednesday Who picked Terrarium? Who picked Terrarium? –The programmer gets to pick some of the names of things in the program. The things that the programmer gets to name are called identifiers.

Wednesday Identifiers are bound by several rules that are compiler enforced. Identifiers are bound by several rules that are compiler enforced. We also insert style into our identifiers. Package names contain only lower case letters. Class names have the first letter upper case and subsequent words in upper case. We also insert style into our identifiers. Package names contain only lower case letters. Class names have the first letter upper case and subsequent words in upper case.

Friday Announcements Pick up Syllabus if you need one Pick up Syllabus if you need one Recitation Change Form Recitation Change Form Lab 1 Prep Work Lab 1 Prep Work Last Day to drop/add Spring 2008 courses is today Last Day to drop/add Spring 2008 courses is today

Friday Game Plan Creating a Java source code file Creating a Java source code file

Friday Java source code written in a file with a.java extension Java source code written in a file with a.java extension Use compiler (javac) to create a file with bytecode (has.class extension) Use compiler (javac) to create a file with bytecode (has.class extension) Run the bytecode using the JVM. Run the bytecode using the JVM.

Friday.java file contains:.java file contains: –Package declaration –Class definition

Friday Package declaration Package declaration package identifier; package identifier; package is a keyword package is a keyword Identifier is name of package. Can be nested. Would use. to separate nested packages. Identifier is name of package. Can be nested. Would use. to separate nested packages.

Friday Class definition made up of: Class definition made up of: –Class Header –Class Body

Friday Class Header Class Header –public class identifier public is a keyword which is also an access control modifier – tells you who has access to the elements public is a keyword which is also an access control modifier – tells you who has access to the elements class is a keyword indicating a class was about to be defined class is a keyword indicating a class was about to be defined identifier is name of class identifier is name of class

Friday Class Body contains Class Body contains –Definition of properties –Definition of capabilities Surrounded by { and } Surrounded by { and }