জাভা এর ক্লাস এবং অবজেক্ট কি - What is Java porogram classes and objects Bangla
জাভা এর ক্লাস: জাভার ক্লাস হলো একটি ভার্চুয়াল পার্ট এখানে কোনো মেমোরি খরচ হয়না। এখানে শুধু মাত্র কোনো কিছুর বৈশিষ্ট্য এবং তার ক্রিয়াকলাপ নিয়ে আলোচনা করা হয়।
জাভা এর অবজেক্ট: জাভার ক্লাস হলো একটি রিয়্যাল পার্ট এখানে কোনো মেমোরি খরচ হয়। এখানে শুধু মাত্র ক্লাসের বৈশিষ্ট্য এবং তার ক্রিয়াকলাপ নিয়ে কাজ করে।
এখানে নিচের কোডটি ভালো মতো লক্ষ্য করুন :
public class Cow {
// common propartis
int age=2;
int weight= 80;
String color="Red";
// common propartis
// Behaviour
void run()
{
System.out.println("The Cow is running");
}
void sleep()
{
System.out.println("The Cow is sleeping");
}
void eat()
{
System.out.println("The Cow is eating");
}
// Behaviour
public static void main(String[] args)
{
Cow co =new Cow();
// Co is object
System.out.println(co.age);
System.out.println(co.weight);
System.out.println(co.color);
co.eat();
co.sleep();
co.run();
}
}
WorldTimeTech provides Top News,Education, Health Tips, Lifestyle, Science and Technology, Computer Help Tips and Unknown facts and also more and more. We Always Try to Give You Helpful Content to you. Thank You...
Copyright © 2023 WorldTimeTech.com All Rights Reserved.