0% found this document useful (0 votes)
2 views1 page

Java Programs

The document outlines a lab assignment for Object Oriented Programming, consisting of two parts. Part A includes 10 Java programming tasks such as displaying 'Hello World', implementing variable types, and demonstrating inheritance. Part B includes 5 additional tasks focused on exception handling, palindrome checking, and prime number generation.

Uploaded by

sushanth.hanagud
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Java Programs

The document outlines a lab assignment for Object Oriented Programming, consisting of two parts. Part A includes 10 Java programming tasks such as displaying 'Hello World', implementing variable types, and demonstrating inheritance. Part B includes 5 additional tasks focused on exception handling, palindrome checking, and prime number generation.

Uploaded by

sushanth.hanagud
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

OBJECT ORIENTED PROGRAMMING LAB

PART A

1. Java program to display “Hello World” and display the size of all the data types.
2. Java program to implement the usage of static, local and global variables.
3. Java program to implement string operations string length, string concatenate, substring
4. Java program to find the maximum of three numbers
5. Java program to check whether the number is odd or even.
6. Java program to implement default and parameterized constructors.
7. Java program to implement an array of objects.
8. Java program to implement Single Inheritance
9. Java program to demonstrate a division by zero exception
10. Java program that demonstrates run-time polymorphism.

PART B
11. Java program to catch negative array size Exception. This exception is caused when the
array is initialized to negative values.
12. Java program to handle null pointer exception and use the “finally” method to display a
message to the user.
13. Java program to check whether a number is palindrome or not
14. Java program to find the factorial of a list of numbers reading input as command line
argument.
15. Java program to display all prime numbers between two limits.

You might also like