assignment (1)
assignment (1)
ArrayList
1. What is an ArrayList in Java, and how does it differ from a regular array?
2. Write a Java program to create an ArrayList, add some elements, and print out the
collection.
2. Discuss scenarios where this is essential, such as avoiding naming conflicts and accessing
instance variables.
1. Explain the role of the Java Native Interface (JNI) in native method implementation.
2. Define a class and an object in the context of Java. How do they relate to each other?
3. What is Object-Oriented Programming (OOP)? Explain its importance in software
development.
Assignment 3
Subject Code:CSE253
Subject Name: Object Oriented Programming in Java Date of Submission: 19/9/24
Constructor Overloading
1. Create a class Rectangle with attributes length and width. Implement multiple constructors
to initialize these attributes in different ways (e.g., default constructor, parameterized
constructor). Write a program to create Rectangle objects using different constructors and
display their dimensions.
2. Explain the concept of method overloading in object-oriented programming. How does
method overloading differ from constructor overloading?
1. What are Wrapper classes in Java, and why are they used?
2. Write a Java program to demonstrate the conversion of a primitive data type to its
corresponding Wrapper class object and vice versa.
String Handling
1. What does it mean when we say that strings are immutable in some programming
languages like Java ? Provide an example to demonstrate the concept of string
immutability and discuss its advantages and potential downsides.
2. Write a program to demonstrate basic string operations such as concatenation, length
calculation, character extraction, substring extraction, and string comparison.