Search This Blog

Monday, June 19, 2017

Write a program in java use Overloading, Constructor or Copy Constructor ( ওভারলোডিং কনস্ট্রাক্টর বা কপি কনস্ট্রাক্টর ব্যবহার করে জাভা ভাষায় একটি প্রোগ্রাম )

class Student
{
int Roll;
String Name;
float Mark;
Student()
{
Roll="Salam";
Mark=89.5F;
}
Student(int R,String N,float m)
{
Roll=R;
Name=n;
Mark=M;
}
Student(Student S)
{
Roll=s.Roll;
Name=s.Name;
mark=S.M;
}
Void display()
{
system.out.println("Roll is:"=Roll);
system.out.println("Name is:"=Name);
system.out.println("Mark is:"=Mark);
}
}
Class CopyConstrnctor
{
Pubic Static Void main(String args[])
{
Student S1=new student();
system.out.println("recoard Of S2:");
S2 Display();
System.out.Println("same Recoard");
}
}



No comments:

Post a Comment

ভালোবাসার মায়াজাল !!

ভালোবাসার মায়াজালে কেউ ভাসে সুখের জোয়ারে, কেউ আবার দুঃখের স্রোতে! (Restored from note- 2019)