Anda di halaman 1dari 4

LIST OF EXPERIMENTS

1. Write a program to display the default value of all primitive data types in Java.

2. Write a Java program that prints all real solutions to the quadratic equation ax2+bx+c = 0. Read in a, b, c
and use the quadratic formula. If the discriminate b2-4ac is negative, display a message stating that there
are no real solutions.

3. The Fibonacci sequence is defined by the following rule. The first 2 values in the sequence are 1, 1. Every
subsequent value is the sum of the 2 values preceding it. Write a Java program that uses both recursive and

non-recursive functions to print the nth value of the Fibonacci sequence.

4. Write a Java program to give an example for command line arguments.

5. Write a Java program to sort given list of numbers.

6. Write a Java program to implement linear search.

7. Write a Java program to implement binary search.

8. Write a java program to add two given matrices.

9. Write a java program to multiply two given matrices.

10. Write a java program for sorting a given list of names.

11. Write a java program that checks whether a given string is a palindrome or not. Ex: MADAM is

a palindrome.

12. Write a java program that prompts the user for an integer and then prints out all the prime numbers up

to that Integer.

13. Write a java program that performs call by value and call by reference.
14. Write a java program that gives an example for this operator and the use of this keyword.

15. Write a java program that gives an example for super keyword.

16. Write a java program that gives demonstration of static variables and methods.

17. Write a java program that illustrates the simple inheritance.

18. Write a java program that illustrates the multilevel inheritance.

19. Write a java program that demonstrates the difference between method overloading and overriding.

20. Write a java program that demonstrates the difference between method overloading and constructor

overloading.

21. Write a java program that describes the exception handling mechanism.

22. Write a java program that uses try and catch blocks and check whether the given array size is negative or

not.

23. Write a java program that describes the user defined exception.

24. Write a java program that illustrates the creation of threads by using runnable class.

25. Write a java program that illustrates the creation of threads by extending Thread class a constructor that

calls the base class constructor, using super and starts the thread. Run method of the class starts after this.

It can be observed by both main thread and created child thread is executed concurrently.

26. Write a java program that illustrates the multiple inheritances by using interfaces.

27. Write a java program to create a package named p1, and implement this package in ex1 class.

28. Write a java program to create a package named my pack, and import it in circle class.

29. Write a java program that illustrates the example for abstract class.

30. Write a java program that describes the life cycle of an applet.

- A java program to create a dialog box and menu.

- A java program to create a grid layout control.

31. A java program to create a border layout control.

32. A java program to create a padding layout control.


33. Write an Applet that creates a simple calculator.

34. Write a java program that displays the x and y position of the cursor movement using Mouse.

35. Write a java program that displays the number of characters, lines and words in a text file.

Anda mungkin juga menyukai