Lab 1
Lab 1
1.1 WAP in Java to calculate the area of rectangle and triangle. (Make
necessary assumptions if needed.)
Program:
Output:
1.2 Implement above problem using method overloading and use
constructor to initialize variables.
Program:
Output:
1.3 WAP to find the smallest and largest element and sum of all the
elements of an array.
Program:
Output:
1.4 Implement the following class diagram. Make necessary assumptions if
necessary.
Program:
Output:
Output:
1.6 WAP in java to demonstrate ArithmeticException,
ArrayIndexOutOfBoundException, NullPointerException,
NumberFormatException separately. [Make necessary assumptions]
Program:
Output:
1.7 WAP in java to read and write content in a file located in your device.
Program:
Output:
1.8 WAP to demonstrate concurrency in java (creating threads by
implementing runnable interface and by extending Thread class).
Program:
Lab18.java
Runnable1.java
Thread1.java
Output: