Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Orientated Programming OOP. What is it? What is this?

Similar presentations


Presentation on theme: "Object Orientated Programming OOP. What is it? What is this?"— Presentation transcript:

1 Object Orientated Programming OOP

2 What is it?

3 What is this?

4 Any ideas?

5 Last Chance!

6 How are these two pictures different?

7 What can a mallard duck do?

8 Can all ducks do those same things?

9 class The class defines all the common properties of the different objects that belong to it. properties For example, there might be a class called shape that contains objects which are circles, rectangles, and triangles.

10 Classes continued Classes are templates used for defining new types. Classes describe both the properties and behaviors of objects. Classes themselves are not objects, but instead they are used to instantiate (i.e., create) objects in memory.

11 objects Generally, any item that can be individually selected and manipulated.selected This can include shapes and pictures that appear on a display screen as well as less tangible software entities.display screensoftware In object-oriented programming, for example, an object is a self-contained entity that consists of both data and procedures to manipulate the data.object-oriented programmingdata procedures

12 method In object-oriented programming, a procedure that is executed when an object receives a message.object-oriented programming procedureobject A method is really the same as a procedure, function, or routine in procedural programming languages.function routine The only difference is that in object- oriented programming, a method is always associated with a class.class

13 “Hello World” public class Hello { public static void main(String[] args) { // display a greeting in the console window System.out.println(“Hello, World!”); }

14 Parameter (argument) A value or expression passed in a method call. The purpose of a parameter is to pass information to a method.

15 “Hello World” public class Hello { public static void main(String[] args) { // display a greeting in the console window System.out.println(“Hello, World!”); }

16 System.out.println(“Hello, World!”); “Hello, World!” is the actual parameter or agrument of the method println.

17 In the first two tutorials in Alice, what actual parameters have you passed?


Download ppt "Object Orientated Programming OOP. What is it? What is this?"

Similar presentations


Ads by Google