February 2 - 6, 2009.  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.

Slides:



Advertisements
Similar presentations
2.4 Creating and Using Objects. Writing the code for classes of your own will come later. At this time it is possible to understand and correctly write.
Advertisements

Classes  All code in a Java program is part of a class  A class has two purposes  Provide functions to do work for the programmer  Represent data.
Java Syntax, Java Conventions, CSE 115 Conventions (Part 1) CSE 115 Spring 2006 January 25 & 27, 2006.
Chapter 41 Defining Classes and Methods Chapter 4.
Encapsulation, Inheritance & Interfaces CSE 115 Spring 2006 February 27, March 1 & 3, 2006.
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.
Java Keywords CSE 115 Spring Purpose This set of slides contains a running list of the keywords that we have talked about so far this semester and.
Slides prepared by Rose Williams, Binghamton University Chapter 13 Interfaces and Inner Classes.
Week 2 Recap CSE 115 – Spring Object Oriented Program System of objects that communicate with one another to solve some problem.
26-Jun-15 Methods. About methods A method is a named group of declarations and statements You execute those declarations and statements by calling the.
CS 201 Functions Debzani Deb.
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 Week 4 February 4 - 8, Monday Announcements Software installation fest Tuesday & Wednesday 4-7 in Baldy 21. Software installation fest Tuesday.
30-Jun-15 Static Methods. About methods A method is a named group of declarations and statements You execute those declarations and statements by calling.
Introduction to Classes and Objects CS-2303, C-Term Introduction to Classes and Objects CS-2303 System Programming Concepts (Slides include materials.
Week 3 Recap CSE 115 – Fall Java Source Code File Made up of: Package declaration Class definition.
Writing methods. Calling Methods nameOfMethod(parameters) if method returns something, use that value Math.pow(2, 3) returns 8 System.out.println(Math.pow(2,
1 Memory Model of A Program, Methods Overview l Memory Model of JVM »Method Area »Heap »Stack.
CSE 115 Week 2 January , Wednesday Announcements Pick up Syllabus if you need one Pick up Syllabus if you need one Recitation Change Form.
Compiling and Linking. Compiling is quite the same as creating an executable file! Instead, creating an executable is a multistage process divided into.
Introduction to Methods
Hello AP Computer Science!. What are some of the things that you have used computers for?
Comp 248 Introduction to Programming Chapter 4 - Defining Classes Part A Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
Week 3 Part I Kyle Dewey. Overview Odds & Ends Constants Errors Functions Expressions versus statements.
Comp 249 Programming Methodology Chapter 8 - Polymorphism Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia University, Montreal,
TOPIC 3 INTRODUCTION TO PROGRAMMING 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B.
Java The Beginning. Why Java?  Currently, this is the language of the international AP course which runs Feb-Apr  FREE!  Platform-independent  Simple.
CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall 1.
4.1 Instance Variables, Constructors, and Methods.
Introduction to the “this” reserved word Java - Supplemented Learning By: Keenan Ratushniak.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Object Oriented Programming … and other things you need to program in java.
Lecture 8 February 29, Topics Questions about Exercise 4, due Thursday? Object Based Programming (Chapter 8) –Basic Principles –Methods –Fields.
Programming in Java CSCI-2220 Object Oriented Programming.
1 CSE1340 Class 4. 2 Objectives Write a simple computer program in Java Use Swing components to build the GUI Use proper naming conventions for classes.
Introduction to Methods. Previously discussed There are similarities in make up of that can help you remember the construct of a class a class in the.
February ,  2/16: Exam 1 Makeup Papers Available  2/20: Exam 2 Review Sheet Available in Lecture  2/27: Lab 2 due by 11:59:59pm  3/2:
Hello Computer Science!. Below is an example of a Hello World program in JAVA. While it is only three lines of code, there are many things that are happening.
M1G Introduction to Programming 2 5. Completing the program.
CSI 3125, Preliminaries, page 1 Compiling the Program.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
Functions  A Function is a self contained block of one or more statements or a sub program which is designed for a particular task is called functions.
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Today: –Review declaration, implementation, simple class structure. –Add an exception class and show.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
Programming in java Packages Access Protection Importing packages Java program structure Interfaces Why interface Defining interface Accessing impln thru.
CS116 COMPILER ERRORS George Koutsogiannakis 1. How to work with compiler Errors The Compiler provide error messages to help you debug your code. The.
© Janice Regan, CMPT 128, Feb CMPT 128: Introduction to Computing Science for Engineering Students Structures.
1 Introduction to Object Oriented Programming Chapter 10.
Methods.
CSC 110 – Intro to Computing - Programming
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
JAVA METHODS (FUNCTIONS). Why are they called methods? Java is a strictly object-oriented programming language Methods are functions inside of objects.
Mr H Kandjimi 2016/01/03Mr Kandjimi1 Week 3 –Modularity in C++
TK1924 Program Design & Problem Solving Session 2011/2012
What Is? function predefined, programmer-defined
Writing Methods.
Subprograms Functions.
CSE 115 September 29 – October 3, 2008.
Comments, Prototypes, Headers & Multiple Source Files
CSE 115 September 29 – October 3, 2008.
Function Overloading CSCE 121 J. Michael Moore
Elements of a Python Program
Workshop for Programming And Systems Management Teachers
Classes and Objects VB.net.
February , 2009 CSE 113 B.
February , 2009 CSE 113 B.
February 2 - 6, 2009 CSE 113 B.
What Is? function predefined, programmer-defined
Presentation transcript:

February 2 - 6, 2009

 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

 Java programs are made up of Java source code files that contain Java source code, are compiled by the compiler and then run using the run-time environment.  These Java source code files all have a filename and an extension.  The filename corresponds to the name of the class defined in the file.  The extension is.java

 Contain the definition of one class.  The class’ name determines the name of the file.  A class is a definition of a set of objects. You should think of a class like a blueprint, a rubber stamp, a mold.  This definition tells us exactly what a particular instance (object) should be like and how it should behave.

public class Name { } Name is the name that the programmer gives to the class.

 The definition on the previous slide is a valid class definition.  However the class that was defined is not very interesting. It doesn’t do anything.  We need to put some stuff inside the { } to help define what objects of this class should do.

 The first thing we will learn about putting inside the { } (called the class’ body) are methods.  We have been calling methods to have objects we created do something for us.  Now we will be writing the definition of what those methods should do.

public returnType nameOfMethod() { } returnType is the type of information that is returned from this method nameOfMethod is the name that the programmer picks for this method () is called a parameter list when we write the definition of a method