Professional Documents
Culture Documents
2. Differentiate between for loop and for each loop with suitable
examples.
7. Explain different ways the static, final and this keyword are applied
to variables, methods or classes in Java programming with relevant
examples.
Assignment 2:
Q1.
Q2.
Q3.
Q4.
Q5.
Q6.
Q7. What is inheritance and its advantages? What are different types of
inheritance supported by using class? Write a Java program for this by
using inheritance.
Q10. How an abstract modifier is used for a class and method in a Java
program. Explain with an example. Differentiate between abstract class
and interface.