From the following Java code determine the attributes of the class student:…
2013
From the following Java code determine the attributes of the class student: class student { string name; int marks; }; public static void main() { student S1 = new student(); student S2 = new student(); }
- A.
Only name
- B.
Both name and marks
- C.
Only S1
- D.
Both S1 and S2
Attempted by 435 students.
Show answer & explanation
Correct answer: B
Answer: The class student has two attributes declared inside it. name — string
A video solution is available for this question — log in and enroll to watch it.