Lyallpur Khalsa College, Jalandhar
Department of Computer Science and IT
LAB Assignment
B.Voc(Software Development)-III
BSD03005L
LAB II: JAVA PROGRAMMING
Note:
File should be handwritten.
Paste output of the program on left hand side and write
content on right hand side of the practical file.
Don’t use loose sheets for practical file
Total Programs-28
1/4
Lyallpur Khalsa College, Jalandhar
Department of Computer Science and IT
LAB Assignment
B.Voc(Software Development)-III
BSD03005L
LAB II: JAVA PROGRAMMING
Program Program Name Page Remark
No. Number
1. Write a program to find the average of two
numbers using Scanner Class
2. Write a program to display the first 5 prime
numbers.
3. WAP to generate first 10 numbers of
Fibonacci series
4. Write a program to display following
patterns for N rows:
*
***
*****
5. Write a Program to demonstrate the
concept of command line arguments.
6. Write a Program to find sum of elements of
an integer array.
7. Write a program to implement add matrix
operation.
8. WAP to demonstrate the use of
parameterized constructor
9. WAP to demonstrate the concept of
constructor overloading.
10. WAP to demonstrate the concept of copy
constructor.
11. WAP to show the concept of method
overloading (take add() as function name)
2/4
Program Program Name Page Remark
Number Number
12. WAP to show the concept of method
overriding.
13. WAP to show the concept of Array of
Objects.
14. WAP to show the concept of simple
inheritance.
15. Demonstrate the two uses of “super”
keyword.
16. Demonstrate the use of Abstract Classes.
17. WAP to prevent method overriding and
class inheritance.
18. WAP to show the concept of multiple
inheritance through interface.
19. WAP to demonstrate the use of packages
using Import Statement.
20. WAP to demonstrate the use of packages
without using Import Statement.
21. Develop a program to store valid user
names and passwords. Create user defined
exception called “Invalid user id Exception”
that is thrown when input strings are not
equal to the stored valid username and
passwords.
22. Write a program in which 3 exceptions
(including one user defined exception) are
thrown and handled by the corresponding
catch blocks appropriately.
23. WAP to demonstrate the difference
between throw and throws keyword.
24. Create GUI which must include at least
8 types of controls using Java
AWT(Mention application name)
3/4
Program Program Name Page Remark
No. Number
25. Create Java AWT Menu and Menu Items
(Create atleast 4 Menus and 4 Menu items
and 2 submenus)
26. WAP to demonstrate the use of Java
ActionListener and Java WindowAdapter
class of AWT
27. WAP by using Java Swing - JTable class to
display data in tabular form (Also mention
Table Name, take atleast 5 columns and 5
rows)
28. WAP to create login form (User name and
Password field) using Java Swing-
JPasswordField class
4/4