You are on page 1of 3

Contents

Assignment List.....................................................................................................................................5
1. Write a Program to print the text “Welcome to World of Java”. Save it with name
Welcome.java in your folder.............................................................................................................5
2. Java Program to check Even or Odd number.............................................................................5
3. Write a Java program to calculate a Factorial of a number.......................................................6
4. Write a Java program to calculate Fibonacci Series up to n numbers........................................6
5. Write a Java program that counts the number of objects created by using static variable.......7
6. Write a java Program to check the number is Prime or not.......................................................7
7. Write a java program to check the given number is Armstrong Number or not........................8
8. Program for Armstrong number for a assigned number............................................................9
9. Write a Java program that prompts the user for an integer and then prints out all the prime
numbers up to that Integer.............................................................................................................10
10. Write a Java program that checks whether a given string is a palindrome or not. Ex:
MADAM is a palindrome..................................................................................................................11
11. Write a Java program to perform basic Calculator operations............................................11
12. Write a Java program that prints the following pattern.......................................................12
13. Write a Java program for sorting a given list of names in ascending order.........................13
14. Write a Java program to multiply two given matrices.........................................................13
15. Write a Java program that reverses a given String...............................................................14
16. Write a Java program to sort the elements using bubble sort.............................................14
17. Write a Java program to search an element using binary search........................................15
18. Write a java program that implements Array Index out of bound Exception using built-in-
Exception.........................................................................................................................................16
19. Write a java program to identify the significance of finally block in handling exceptions.. .16
20. Write a java program that implements user defined exception..........................................17
21. Write a Java program that displays area of different Figures(Rectangle,Square,Triangle)
using the method overloading.........................................................................................................18
22. Write a java program to calculate gross salary & net salary taking the following data........18
23. Write a java program to find the details of the students eligible to enroll for the
examination ( Students, Department combinedly give the eligibility criteria for the enrolment
class) using interfaces......................................................................................................................20
Other Class Programs..........................................................................................................................21
1.Left Shift Operators......................................................................................................................21
2. Right Shift Operations..................................................................................................................21
3. Difference of >> and >>>..............................................................................................................22
5. Ternary Operator.........................................................................................................................23
6. Unary Operator............................................................................................................................23
7. Method Overloading Program.....................................................................................................24
Java Exceptions 5-6/11/20..................................................................................................................24
1. Exception-ArrayIndexOutOfBound..........................................................................................24
2. Multi Catch Exceptions................................................................................................................25
Array Exercises....................................................................................................................................26
1. Array Creation & Access Array Element...................................................................................26
2. Array Creation and printing elements using a loop.................................................................26
3. Array Object and use of constructor........................................................................................27
4. Array and Constructor.............................................................................................................28
Inheritance Exercises with extends and implements keyword..........................................................29
1. Hierachical Inheritance............................................................................................................29
2. Interface Example....................................................................................................................30
3. Mutiple interfaces...................................................................................................................31
Constructors in Java............................................................................................................................32
1. Program for the default Constructor.......................................................................................32
2. Program for Parameterized Constructor.................................................................................32
3. Program for Overloading Constructors....................................................................................33
4. Java Program for inheritance...................................................................................................34
Database Connectivity in Java(lab 1-12-20).......................................................................................35
1. Program:Example1 for Database Connectivity........................................................................35
2. Database connection and RETRIEVING values from the emp table.............................................36
3-Inserting Records to table student(created in mysql) through db connectivity...........................37
4. Java Program to retrieve from the database...........................................................................38
Threads In Java 17-11-20....................................................................................................................41
1. Java Program to display Factorial using Thread.......................................................................41
2. Java Program for Multiple Thread...........................................................................................42
3. Factorial using Runnable..........................................................................................................43
4. Table Creation in Java..............................................................................................................45
5. Multiplication Thread..............................................................................................................47
Packages in Java..................................................................................................................................47
1. Creating a package in Java.......................................................................................................47
2. Package Example 2-Importing pack.*......................................................................................48
3. Example 3: Fully Qualified Path...............................................................................................48
4. Calculator Example..................................................................................................................48
Java String Practical............................................................................................................................49
1. Creating String using String Literal and new Keyword.............................................................49
2. Printing string at odd index location........................................................................................49
3. String compareTo()..................................................................................................................50
4. String concat()..........................................................................................................................50
5. String Builder Example.............................................................................................................51
6. String Buffer Example..............................................................................................................51
Socket Programming in Java...............................................................................................................52
1. Example of Server Setup using socket.....................................................................................52
2. Client Setup.............................................................................................................................52
Program 2—for both read and write...............................................................................................53
Applet Programs.................................................................................................................................54
1. First.java..................................................................................................................................54
2. HTML code...............................................................................................................................54
3. Animation Program..................................................................................................................55
4. Ball Program............................................................................................................................56
5. Image Program........................................................................................................................57
6. Draw 3D Rectangle..................................................................................................................58

You might also like