Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Draw a picture consisting parts of monocot leaf

Answered: 1 week ago