Btech (Cse) V Semester - First Java Assignment
Btech (Cse) V Semester - First Java Assignment
TOTAL MARKS: - 10
Q2. What is JVM (Java Virtual Machine)? Whether JVM is platform independent
or not? Justify your answer.
Q3. Explain
Q4. Explain the difference between class, instance and local variable by
giving appropriate example.
Q6. What are static members? What are the restrictions followed by static
method? main() method is always declared as static, why? Explain it.
1
B.Tech.(CSE) V Semester 2024
FIRST JAVA ASSIGNMENT
Q8. Design a class Complex having a real part (real) and an imaginary part
(imag). Provide methods to perform the following on complex numbers:
1. Add two complex numbers.
2. Multiply two complex numbers.
3. toString() method to display complex numbers in the form: real + i
imag
Q9. Write a Java program to create a class named “Employee” with the
following data member such as Employee Id, Employee Name,
Department, Designation and Salary. Store them in an array of objects.
Input the number of employee from the user at runtime and perform the
following: