OOP - Lab Task-5 - Methods - UML To JAVA Code
OOP - Lab Task-5 - Methods - UML To JAVA Code
OOP - Lab Task-5 - Methods - UML To JAVA Code
2. Find the area of a Circle. Write a method which will receive the radius as argument
and then will return the area. [non-static method]
3. Write a method named maxValue() which will find out the maximum value from two
integer numbers. [Static method with argument and return value]
4. Write a method named maxValue() which will find out the maximum element from an
Array. [Static method with argument and return value]
1. Create the Student Class. Then create two objects of this class. Take User input for the
instance variables.
Student
-name: String
-id: int
-cgpa: double
Page 1 of 3
2. Create the Student Class. Then create N Number objects of this class. Take User input
for the instance variables.
Student
-name: String
-id: int
-cgpa: double
+main(String[]) :void
3. Create the Student Class. Then create N number of objects of this class. Take User
input for the number of objects and the instance variables [Array of Objects].
Student
-name: String
-id: int
-cgpa: double
Page 2 of 3
Home Work
1. Unsolved Problems from the Lab Task - 5.
2. Suppose you are going to start your own company. You need to recruit some employees.
Now, create a class named “Employee” to store the information of them. Convert the
following UML into Java code and store information of three employees.
Employee
-name: String
-id: String
-age: int
-salary: double
Page 3 of 3