Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 CSE 115 Week 2 January 21 - 25, 2008

2 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.

3 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

4 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

5 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

6 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.

7 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.

8 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.

9 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

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

11 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.

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

13 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.

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

15 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

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


Download ppt "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."

Similar presentations


Ads by Google