Assign and print the roll number, phone number and address of two students having
names "Sam" and "John" respectively by creating two objects of class 'Student'.
Answers
Answer:
hshsbxbdbdhdhd is a good day mam please find the best way for you are not the best way for us at the best time for the best time for the answer to your account ☺️ is present on Thursda go to get r
Explanation:
hehehe hdhdh EY is the best way ☺️ is a long term care is taken care is taken to get to
Answer:
class student
{
String address;
int roll_no;
int phone;
String name;
}
public class ans
{
public static void main(String[] args)
{
student object1=new student();
student object2=new student();
object1.name="john";
object1.roll_no=2;
object1.address="john villa";
object1.phone=12354675;
object2.name="sam";
object2.roll_no=3;
object2.address="sam villa";
object2.phone=23133556;
System.out.println("name is "+object1.name+"\nAdress is "+object1.address+"\nroll no is "+object1.roll_no+"\nphone number is "+object1.phone);
System.out.println("name is "+object2.name+"\nAdress is "+object2.address+"\nroll no is "+object2.roll_no+"\nphone number is "+object2.phone);
}
}
Explanation: this program is written in java