Introduction to Object Modelling in Java Java is an Object-Oriented Programming (OOP) language. In OOP, programs are designed by modelling real-world entities as objects . 👉 Object Modelling means representing real-life things inside a program using: Their properties (data) Their behaviour (actions) Components of Object Modelling Every object consists of three main components : 1. State (Properties / Attributes) State represents the data stored in an object . Examples: Student → Name, Roll Number Car → Color, Speed In Java → Variables int roll ; String name ; 2. Behaviour (Actions / Functions) Behaviour represents what the object can do . Examples: Student → Study, Write Exam Car → Start, Stop In Java → Methods void study () { System . out . println ( "Student is studying" ); } 3. Identity (Unique Name) Each object has a unique identity. Example: Student s1 ; Student s2 ; Here: s1 and s2 are different...
Which one will be written on project file icse ix program or project file ix
ReplyDelete