Professional Documents
Culture Documents
Adi Practical
Adi Practical
1) -------------------------------
2) -------------------------------
Computer science
&
Informationtechnology
2020-2021
Batch : CES
Id No : 51983
Page |3
Java
programming
Page |4
INDEX
Sr. Page Remark
Name of Program
No. No. /Sign
Program No.1
Aim : The Use of Any four built in exception.
Name: Aditya G. Khirekar
Roll ID:- 51983
Class: B.Sc-III(sem-VI) Batch:-CES
{
try {
int a = 30, b = 0;
}
catch (ArithmeticException e) {
}
}
}
Page |6
Output:
Can't divide a number by 0
class ArrayIndexOutOfBound_Demo
{
try {
// size 5
}
catch (ArrayIndexOutOfBoundsException e) {
}
}
}
Page |7
Output:
} class Geeks {
} class MyClass {
{
Object o = class.forName(args[0]).newInstance();
}
Output:
ClassNotFoundException
Page |8
Output:
File does not exist
Page |9
Program No.2
Aim: Java AWT list with ActionListener
Name: Aditya G. Khirekar
Roll ID:- 51983
Class: B.Sc-III(sem-VI) Batch:-CES
Source code:
import java.awt.*;
public class ListExample
{
ListExample(){
Frame f= new Frame();
List l1=new List(5);
l1.setBounds(100,100, 75,75);
l1.add("Item 1");
l1.add("Item 2");
l1.add("Item 3");
l1.add("Item 4");
l1.add("Item 5");
f.add(l1);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
new ListExample();
}
}
P a g e | 10
Output:
P a g e | 11