सीधे मुख्य सामग्री पर जाएं

#40 What is Class & Object in Java ? Full Explanation About Class & Object in Java

package com.sudhirtheindian2.java123;

import java.util.Scanner;

public class OurPerson {
public static void main(String[] args) {


// What is class and object in java ?

// and how to create class and object


// Class is a group of elements having common properties and behaviour

// common properties
// age;
// weight;
// height;


// behaviour
// sleep();
// eat();
// run();

// important notes:
// 1 class is virtual
// means there is no memory for the class
// class is logical

// 2 object is real
// there is memory for the object




// types of class

// 1 user defined B, Animal, Bird, Person

// 2 pre defined System, String, Scanner


}





}

टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट