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

Java-program-exercises

The document outlines a series of Java programming exercises categorized into basic programs, classes and objects, Java methods, arrays, exceptions and errors, and string manipulation. Each category contains a list of specific programming tasks designed to enhance understanding and application of Java concepts. The document is intended for students at the Mangalore Institute of Technology & Engineering, under the Department of Information Science & Engineering.

Uploaded by

debabrata480
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Java-program-exercises

The document outlines a series of Java programming exercises categorized into basic programs, classes and objects, Java methods, arrays, exceptions and errors, and string manipulation. Each category contains a list of specific programming tasks designed to enhance understanding and application of Java concepts. The document is intended for students at the Mangalore Institute of Technology & Engineering, under the Department of Information Science & Engineering.

Uploaded by

debabrata480
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MANGALORE INSTITUTE OF TECHNOLOGY & ENGINEERING

Accredited by NAAC with A+ Grade, An ISO 9001: 2015 Certified Institution


A Unit of Rajalaxmi Education Trust®, Mangalore - 575001
Affiliated to V.T.U., Belagavi, Approved by AICTE, New Delhi.

Department of Information Science & Engineering

JAVA PROGRAM EXERCISES


 Basic Programs
1. Java Program to Get Input from the User
2. Java Program to Swap Two Numbers
3. Java Program to Add Two Complex number
4. Java Program to Check Even or Odd Integers
5. Java Program to Find Largest Among 3 Numbers
6. Java Program to Display All Prime Numbers from 1 to N
7. Java Program to Check whether input character is vowel or consonant
8. Java Program to Find Factorial of a number
9. Java Program to Find Even Sum of Fibonacci Series Till number N
10. Java Program to Calculate Simple Interest

 Classes and Object Programs


1. Java Program to Create a Class and Object
2. Java Program to Create an Interface
3. Java Program to Show Inheritance in Class
4. Java Program to Show Data Hiding in Class
5. Java Program to Show Polymorphism in Class
6. Java Program to Show Overloading of Methods in Class
7. Java Program to Show Overriding of Methods in Classes
8. Java Program to Show Use of Super Keyword in Class
9. Java Program to Show Use of This Keyword in Class
10. Java Program to Show Usage of Static keyword in Class

 Java Methods Programs


1. Java Program to Show Usage of Main() method
2. Java Program to Show Use of Static and Non-static Methods
3. Java Program to Show Usage of forEach() Method
4. Java Program to Show Usage of toString() Method
5. Java Program to Show Usage of codePointAt() Method
6. Java Program to Show Usage of compare() Method
7. Java Program to Show Usage of equals() Method
8. Java Program to Show Usage of hasNext() and next() Method
9. Thread Lifecycle Methods
a. start() Method
b. run() Method
MANGALORE INSTITUTE OF TECHNOLOGY & ENGINEERING
Accredited by NAAC with A+ Grade, An ISO 9001: 2015 Certified Institution
A Unit of Rajalaxmi Education Trust®, Mangalore - 575001
Affiliated to V.T.U., Belagavi, Approved by AICTE, New Delhi.

Department of Information Science & Engineering

 Array Programs
1. Java Program For Linear Search
2. Java Program For Binary Search
3. Java Program to Find the Largest Element in an Array
4. Java Program to Sort an Array
5. Java Program to Merge Two Arrays
6. Java Program to Copy All the Elements of One Array to Another Array
7. Java Program to Print a 2D Array
8. Java Program to Add Two Matrices
9. Java Program to Find the Transpose
10. Java Program to Print Boundary Elements of a Matrix

 Exceptions and Errors Programs


1. Java Program to Show Runtime exceptions
2. Java Program to Show Types of errors
3. Java Program to Handle the Exception Hierarchies
4. Java Program to Handle the Exception Methods
5. Java program to Handle the Checked exceptions
6. Java Program to Handle the Unchecked Exceptions
7. Java Program to Handle Divide By Zero and Multiple Exceptions
8. Java Program to Show Unreachable Code Error
9. Java Program to Show Thread interface and memory consistency errors

 String Programs
1. Java Program to Get a Character From the Given String
2. Java Program to Reverse a String Using Stacks
3. Java Program to Sort a String
4. Java Program to Swapping Pair of Characters
5. Java Program to Check Whether the Given String is Pangram
6. Java Program to Remove leading zeros
7. Java Program to Compare two strings
8. Java Program to Compare two strings lexicographically
9. Java Program to Insert a string into another string
10. Java Program to Splitting into a number of sub-strings

HoD

You might also like