Assignment 2 OOPJ

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

GOVERNMENT POLYTECHNIC, AHMEDABAD

DEPARTMENT OF INFORMATION TECHNOLOGY


TERM: 01/02/2024 TO 25/05/2024 [232]

Course Code: 4341602 Semester: 4th


Course Title: Object Oriented Programming with JAVA

Date:

ASSIGNMENT-2 (Unit -2)

This assignment covers following course outcome:

CO2: Understand building blocks of OOPs language, inheritance, package and


interfaces.

1. Explain the concept of method overloading in Java with suitable


example
2. Discuss the differences between the String class and the
StringBuffer class in Java.
3. Implement a program that performs various operations on strings,
such as concatenation, substring extraction, and length calculation,
using the String class methods.
4. Describe the concept of access control and modifiers in Java.
Provide examples illustrating the use of access modifiers like
private, public, protected, and default.
5. Discuss the significance of the "this" keyword in Java. Provide
examples demonstrating its usage in different contexts, such as
resolving naming conflicts and accessing instance variables.
6. Explain the role of the static keyword in Java.
7. What is wrapper class? Explain with example.
8. Explain final keyword with example.
9. Discuss various types of constructors in Java, including default
constructors, parameterized constructors, and copy constructors.
Provide examples demonstrating the use of each type of
constructor, along with constructor overloading.

You might also like