0% found this document useful (0 votes)
11 views15 pages

Java Programming Exercises for ASET

Uploaded by

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

Java Programming Exercises for ASET

Uploaded by

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

1.

Write a Java program to determine greatest number and lowest number


from a given list.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


2. Write a program to sum the values of a Single Dimensional array.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


3. Design & execute a program in Java to sort numeric array string & array.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


4. Find the index of an array element by writing a program in Java.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


5. Write a Java program to insert an element (on a specific position) into a
Multidimensional array.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


6. Write a program to perform the following operations on strings:
i. Compare two strings. ii. Count string length. iii. Convert upper case to lower
case & vice versa. iv. Concatenate two strings. v. Print a substring.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


7. Write a Program & design a method to count all vowels in a string.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


8. Write Java program to implement inheritance using constructor & method.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


9. Write a Java program to handle the following exceptions:
(a) Divided by Zero Exception. (b) Array Index Out of Bound Exception.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


10. Write java program for Method overloading using example of area
function.
Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


11. Write a java program for Constructor overloading.

Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


12. Write a java program to take input of an employee and display the
employee details using Scanner class.
Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


13. Write a java program to represent Abstract class with example.
Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


14. Write Java code on use of inheritance, preventing inheritance using final.
Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab


15. Write a java program to implement Interface using extends keyword.
Input:

Output:

Amity School Of Engineering & Technology (ASET), Punjab

You might also like