0% found this document useful (0 votes)
4 views

Java_Practice_Exam

The document outlines a Java practice test consisting of five questions. It includes tasks such as creating classes for a 'Person', calculating the area of a rectangle and a triangle, explaining JVM architecture, and discussing different types of classes in Java. Each question is worth 6 marks and requires programming or theoretical explanations.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Java_Practice_Exam

The document outlines a Java practice test consisting of five questions. It includes tasks such as creating classes for a 'Person', calculating the area of a rectangle and a triangle, explaining JVM architecture, and discussing different types of classes in Java. Each question is worth 6 marks and requires programming or theoretical explanations.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Practice test

Time:60 min

1. Consider two different objects one boy and one girl. The boy has some properties like
hairColor = “black”, eyeColor = “black”, skinColor = “Fair”, height = “5.10 inch”, weight = “65
kg” and actions are read(), play(), sleep(), walk().A girl has some properties like hairColor =
“brown”, eyeColor = “brown”, skinColor = “milky white”, height = “5.4 inch”, weight = “50
kg” and actions are read(), play(), sleep(), walk(). Here, the type of both boy and girl is the same.
Type is “Person”. So, the class name is “Person”. (6 Marks).
2. Write a program to print the area of a rectangle by creating a class named 'Area' taking
the values of its length and breadth as parameters of its constructor and having a method
named 'returnArea' which returns the area of the rectangle. Length and breadth of
rectangle are entered through keyboard. (6 Marks)
3. Draw and Explain JVM Architecture with all its components. (6 Marks)
4. Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5
units by creating a class named 'Triangle' with constructor having the three sides as its
parameters. (6 Marks).
5. What is Class, explain different types of classes with example of each class also explain
which type of variables, methods and block is possible in each class. (6 Marks)

You might also like