OOPS
August 29, 2024OOPS
August 29, 2024OOPS
Question 123 |
From the following java determine the attributes of the class students:
Class student
{
String name;
Int marks;
};
Public static void main()
{
Student S1=new student();
Student S2=new student();
}
Class student
{
String name;
Int marks;
};
Public static void main()
{
Student S1=new student();
Student S2=new student();
}
Only name | |
Both name and marks | |
Only S1 | |
Both S1 and S2 |
Question 123 Explanation:
→ The attributes of student class are name and marks.
→ There are two objects created in the above program and both have same attributes.
→ There are two objects created in the above program and both have same attributes.
Correct Answer: B
Question 123 Explanation:
→ The attributes of student class are name and marks.
→ There are two objects created in the above program and both have same attributes.
→ There are two objects created in the above program and both have same attributes.