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

assignment (1)

The document outlines three Java assignments for the course CSE253: Object Oriented Programming in Java, detailing tasks related to data types, operators, decision making, loops, arrays, ArrayLists, the 'this' keyword, Java Native Method implementation, constructor overloading, wrapper classes, and string handling. Each assignment includes specific programming tasks and questions aimed at reinforcing concepts in Java programming. Submission dates for each assignment are provided, with the first due on September 3, 2024, and subsequent assignments due on September 16 and September 19, 2024.

Uploaded by

2023259383.parth
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

assignment (1)

The document outlines three Java assignments for the course CSE253: Object Oriented Programming in Java, detailing tasks related to data types, operators, decision making, loops, arrays, ArrayLists, the 'this' keyword, Java Native Method implementation, constructor overloading, wrapper classes, and string handling. Each assignment includes specific programming tasks and questions aimed at reinforcing concepts in Java programming. Submission dates for each assignment are provided, with the first due on September 3, 2024, and subsequent assignments due on September 16 and September 19, 2024.

Uploaded by

2023259383.parth
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Java Assignment 1

Subject Code:CSE253 Date of Issue:29/8/24


Subject Name: Object Oriented Programming in Java Date of Submission: 3/9/24

1. Data Types and Variables:


o Create a program that prompts the user for their name and greets them with a
personalized message. (Hello+ <Name of person>+Welcome)
o Write a program that converts temperature from Celsius to Fahrenheit or vice versa
based on user input.
2. Operators and Expressions:
o Implement a program that calculates the area of a rectangle given its length and
width.
o Create a simple interest calculator that takes principal amount, rate, and time as
input and computes the interest.
3. Decision Making (Branching):
o Write a program that checks if a given year is a leap year.
o Implement a menu-driven program that allows the user to choose between different
geometric shapes (circle, square, triangle) and calculates their area.
4. Loops:
o Create a program that prints the multiplication table for a given number up to a
specified limit.
o Write a program that generates the sum of all even numbers between 1 and n.
5. Arrays:
o Implement a program that finds the average of elements in an integer array.
o Create a program that reverses the order of elements in an array.
Assignment 2
Subject Code:CSE253
Subject Name: Object Oriented Programming in Java Date of Submission: 16/9/24

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.

This keyword in Java:

1. What is the purpose of this keyword in Java?

2. Discuss scenarios where this is essential, such as avoiding naming conflicts and accessing
instance variables.

Java Naitive Method Implementation

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?

Wrapper Classes in Java

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.

You might also like