Question: Q 1 . Create a class named Student with the fields: StudentName, StudentID, Age and MobileNo ( data types are String and int ) .

Q1. Create a class named Student with the fields: StudentName, StudentID, Age and MobileNo (data types are String and int). Declare an empty and a parameterized Constructor for class(Student) and set the StudentName and StudentID.
(2 Mark)
Q2. Declare an accessor method PrintStudent() in Student class to display student details, and a mutator method UpdateAge() to increase the Age of a student by 2 years and print the updated Age.
(2 Mark)
Q3. Differentiate between primitive type and object type. Give 2 examples of each.
Mark)
Q4. Draw Class Diagram and Object Diagram from the below given Details. (2 Marks)
public class University
{
private Student stdob;
private Faculty fctob;
}
Q5. From the given class diagram and object diagram, write a code snippet to show objects creating objects.
(2 Mark)
 Q1. Create a class named Student with the fields: StudentName, StudentID,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!