JAVA LAB PROGRAMS SEM-3 NEP 1-12 (3)
JAVA LAB PROGRAMS SEM-3 NEP 1-12 (3)
1. Program to read the radius of a circle and to find the area and /*LAB#1 Write a Java program to read the radius of a circle and
circumference. to find the area and circumference. */
2. Program to demonstrate String Operators import java.util.Scanner;
3. Program to find N prime numbers reading N as command line public class circle {
argument. public static void main(String args[]) {
4. Program to find factorial of N numbers reading N as command Scanner io = new Scanner(System.in);
line argument. System.out.println("Input the radius of the circle: ");
5. Program to read N numbers and sort them using one- double r = io.nextDouble();
dimensional arrays. System.out.println("Area is = " + (Math.PI * r * r));
System.out.println("circumference is = " + (2 * Math.PI * r));
6. Program to illustrate Method Overloading.
7. Program to illustrate Operator Overloading. }
8. Program to demonstrate Single Inheritance. }
9. Program to illustrate Constructor Overloading
10. Program to illustrate Method Overriding Output: