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