17MCA37 Java Programming Laboratory syllabus for MCA



A d v e r t i s e m e n t

Module-1 0 hours

CO4: Implement the multithreading and client side programming.

1. a) Write a JAVA program to demonstrate Constructor Overloading and Method Overloading.

b) Write a JAVA program to implement Inner class and demonstrate its Access protection.

 

2. Write a program in Java for String handling which performs the following:

i) Checks the capacity of StringBuffer objects.

ii) Reverses the contents of a string given on console and converts the resultant string in upper case.

iii) Reads a string from console and appends it to the resultant string of (ii).

 

3. a). Write a JAVA program to demonstrate Inheritance.

b). Simple Program on Java for the implementation of Multiple inheritance using interfaces to calculate the area of a rectangle and triangle.

 

4. Write a JAVA program which has

i) A Class called Account that creates account with 500Rs minimum balance, a deposit()method to deposit amount, a withdraw() method to withdraw amount and also throws LessBalanceException if an account holder tries to withdraw money which makes the balance become less than 500Rs.

ii) A Class called LessBalanceException which returns the statement that says withdraw amount ( Rs) is not valid.

iii) A Class which creates 2 accounts, both account deposit money and one account tries to withdraw more money which generates a LessBalanceException take appropriate action for the same.

 

5. Write a JAVA program using Synchronized Threads, which demonstrates Producer Consumer concept.

 

6. Write a JAVA program to implement a Queue using user defined Exception Handling (also make use of throw, throws).

 

7. Complete the following:

1. Create a package named shape.

2.Create some classes in the package representing some common shapes like Square,Triangle, and Circle.

3. Import and compile these classes in other program.

 

8. Write a JAVA program to create an enumeration Day of Week with seven values SUNDAY through SATURDAY. Add a method isWorkday( ) to the DayofWeek class that returns true if the value on which it is called is MONDAY through FRIDAY. For example, the call DayOfWeek.SUNDAY.isWorkDay ( ) returns false.

 

9. Write a JAVA program which has

i). A Interface class for Stack Operations

ii). A Class that implements the Stack Interface and creates a fixed length Stack.

iii).A Class that implements the Stack Interface and creates a Dynamic length Stack.

iv). A Class that uses both the above Stacks through Interface reference and does the Stackoperations that demonstrates the runtime binding.

 

10. Write a JAVA program to print a chessboard pattern

 

11. Write a JAVA program which uses FileInputStream / FileOutPutStream Classes.

 

12. Write JAVA programs which demonstrates utilities of LinkedList Class.

 

13. Write a JAVA program which uses Datagram Socket for Client Server Communication.

 

14. Write a JAVA applet program, which handles keyboard event.

 

Note 1: InthepracticalExaminationstudent has to executeoneprogramfroma lot of all the 14 questions.

Note 2: Change of program is not permitted in the Practical Examination.

Last Updated: Tuesday, January 24, 2023