Download presentation
Presentation is loading. Please wait.
1
Object Orientated Concepts
2
Overview The world is objects Defining an object Not a function, it’s a method Lets inherit want we can Objects don’t have ‘mains’ Look at some Java Code
3
The world is objects (pg 34) Everything is an object. They have values Things can be done to them In small groups, starting with the object of a car, what are some methods about the car?
4
How does Java know what an object looks like? Class definition public class ExampleApp{ public static void main (Strings[] args){ //some main code } public void ExampleMeth{ //Some other code }
5
Not a function, it’s a method Methods can be public or private In C, all functions are public They work on the object and sometimes accept inputs
6
Lets inherit want we can (pg. 31) An object ‘cat’ is a subset of ‘animal’ hence cat inherits the traits of animal A new object ‘mushroom’ might inherit some of the ‘animal’ superclass but would have some very different methods and instance variables
7
Objects don’t have ‘mains’(pg.38) Objects don’t have a ‘main’ If there is a ‘main’ it should test the current object only
8
Lets look at some Java code in detail (pg. 39) Take a few minutes to look over the code on page 39.
9
Things to remember Java and C share some syntax This can be tricky When doing OOP, think of code as interacting objects rather than a program that does different tasks OOP can lead to easier revisions later, but a lot of the worlds code is not OOP
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.