Thursday, 11 November 2021

object_oop

oops

Object Orinted programming

3 object

Object is instance of class of real world entity ,it is occupies memory Any entity that has state and behavior is known as an object

Object consist of :--
1.Identity
2.state/artibute
3.Behavior own

How to create objects :--------- 5 Ways

  • By using new Keyword
  • by using new instance
  • by using clone()
  • by using factory method
  • by using delecatrive method

Object

# syntax

ClassName objectName = new ClassName

dot (.) operator is used to calling classs method or class Behavior in the given class.

class demo example

  • public Animal
  • {
  • public void eat()
    {
  • System.out.println( " i am eating ");
  • }
  • public static void main (String args[])
    {
  • Animal aa = new Animal () ; ................//create the object of class
  • aa.eat() ; ................//call the method
  • }
  • }
  • C++ is cooming soon

    comming soon

    CONTENT FIR TAB 4

    i am eating

    No comments:

    Post a Comment

    How do you select data from a table in SQL?

    Create Table How do you select data a table in SQL? The SELECT statement is used to se...