Assignment 6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Practical Questions:

Collections:
1. Write a java program to add elements to the ArrayList and insert, and delete
flowers from the flowerlist and display it.
2. Write a java program to add elements to a linkedList of fruits and use iterator and
listIterator to display the elements, modify the elements and remove the
elements. Also display the elements.

String Functions:

1. Java program to count the total number of characters in a string.

2. Java program to count the total number of punctuation characters that exist in a
string.

3. Java program to count the total number of consonants and vowels in a string.
4. Java Program to find maximum and minimum occurring characters in a string.

5. Java Program to swap two string variables without using a third or temp
variable.

6. Java Program to remove all the white spaces from a string.

7. Java Program to replace lower-case characters with upper-case and


vice-versa.
Threads:(Not the examples done in the class, different example)

1. Create a Thread extending the Thread class.

2. Create a Thread implementing the Runnable interface.

3. Create Multiple threads from a thread class.

4. Write a program to show synchronization of thread and thread control in


java.

Exceptions:(Please don’t repeat the questions done in the class)

1. Write a program to show NumberFormatException in a java program.

2. Write a program to catch multiple Exceptions in java.

3. Write a program to show the working of the finally block.

4. Write a program to show the use of throws in a java program.

5. Write a program to show throws and throw in a java program.

6. Write a program to show the implementation of user defined exceptions. Create a


user defined exception called BalanceBelowMinLevelException with appropriate
message and implement the same in a method called withdrawAmount() in the
Account class.
Streams:

1. Write a program in java using BufferedStreamReader to read a character data and


print it to the console.

2. Write a program in java using BufferedStreamReader to read a line of data and


print it to the console.

3. Write a program in java using FileStreams to read data from a file and write to the
console. Use try with resources also to do this program.

4. Write a program in java using FileStreams to read from a file and write to another
file. Use try with resources also to do this program.

Swing GUI

1. Write a java program to create a calculator using Swing GUI.

JDBC API

1. Write a program using IntelliJ and MySQL database to create a registration


form for Booking tickets to travel from Cochin to Trivandrum through the
private railway service known as Periyar Railway Services. Users should
be able to insert, update, delete and retrieve the data from the database.

You might also like