0% found this document useful (0 votes)
3 views15 pages

Lab 1

The document outlines a series of programming tasks in Java, including calculating areas of shapes, implementing method overloading, finding array elements, and handling exceptions. It also includes exercises on file operations and concurrency using threads. Each task requires the implementation of specific programs with outputs, emphasizing Java programming concepts and practices.

Uploaded by

unishdhonju1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

Lab 1

The document outlines a series of programming tasks in Java, including calculating areas of shapes, implementing method overloading, finding array elements, and handling exceptions. It also includes exercises on file operations and concurrency using threads. Each task requires the implementation of specific programs with outputs, emphasizing Java programming concepts and practices.

Uploaded by

unishdhonju1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

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:

1.5 WAP in java to implement try-catch, finally and throw statement.


Program:

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:

You might also like