You are on page 1of 12

1

JAVA LAB ASSIGNMENTS


1. 2. 3. 4. 5. 6. Write a Java program to print the prime numbers from 1-100. Write a standalone code in Java to print first 20 odd numbers. Write a Java program to find the factorial of a number. Write a program to display the reverse of a number. Write a program for Fibonacci series. Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) 7. Write a program to sort an array of strings in ascending alphabetical order. 8. Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. 9. Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. 10. Program to Calculate Area of Squares and Rectangle using Constructors 11. Program to Calculate Area of Squares and Rectangle using Method Overloading. 12. Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 13. Write a JAVA program to copy a file. 14. Write a JAVA program to implement multithreading. 15. Write a JAVA program to encrypt a file. 16. Write a JAVA program to implement the server socket. 17. Write a JAVA program to show how priority threads are used. 18. Write a JAVA program to print the content of a file using stream clears. 19. Write a JAVA program to print given string is Palindrome or not. 20. Write a JAVA program to perform Fibonacci series. 21. Write a JAVA program to implement chatting for client. 22. Write a JAVA program to ncr value. 23. Write a JAVA program to using JDBC to create or alter a tipple at runtime. 24. Write a JAVA program to find area of a triangle. 25. Write a JAVA program to create and read a student record with field name, roll no., and marks. 26. Write a JAVA program to count the no. of words, vowels, lines in a given file. 27. Write a JAVA program to raise a undefined exception for minimum balance for a given a/c no. 28. Write a JAVA program to perform Matrix multiplication. 29. Write a JAVA program to create a Client Socket. 30. Write a JAVA program to decrypt a file. 31. Write a JAVA program to send and get data for the local host and the server port using data gram.

2 A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100. A) Write a Java program to print the prime numbers from 1-100.

B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B)

3 Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) B) Write a Java program to check and display message whether the entered three digit number is Armstrong number. (Armstrong Number e.g. 1*1*1+5*5*5+3*3*3=153) C)

4 Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10

C)

5 Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10 C) Write a program to evaluate 24 + 99 + tan-1 (4) + log e 10

D)

6 Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1. D) Write a Java program to find the factorial of a number. 5! = 5*4*3*2*1.

7 E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character

8 E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character E) Write a program to display the reverse of a number. Also write a program to print the reverse of a string. Hint: Use charAt() for printing a character F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. F) Write a program for Fibonacci series. G) Write a standalone code in Java to print odd numbers in the following manner. Program will ask a user about the input, to enter how many odd numbers to print. If user enters 20, it will print first 20 odd numbers. G) Write a standalone code in Java to print odd numbers in the following manner. Program will ask a user about the input, to enter how many odd numbers to print. If user enters 20, it will print first 20 odd numbers. G) Write a standalone code in Java to print odd numbers in the following manner. Program will ask a user about the input, to enter how many odd numbers to print. If user enters 20, it will print first 20 odd numbers.

9 G) Write a standalone code in Java to print odd numbers in the following manner. Program will ask a user about the input, to enter how many odd numbers to print. If user enters 20, it will print first 20 odd numbers. G) Write a standalone code in Java to print odd numbers in the following manner. Program will ask a user about the input, to enter how many odd numbers to print. If user enters 20, it will print first 20 odd numbers. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order. H) Write a program to sort an array of strings in ascending alphabetical order.

10 I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. I) Write a Java program to arrange Neeta, Seeta, Mohan, Ashim, Shama, Geeta in descending order. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package.

11 J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package. J) Create a package Book containing Book name and Publisher name. Call Book name and Publisher name from the package.

K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors

12

K) Program to Calculate Area of Squares and Rectangle using Constructors K) Program to Calculate Area of Squares and Rectangle using Constructors L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading. L) Program to Calculate Area of Squares and Rectangle using Method Overloading.

You might also like