NEP -JAVA

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6

PART B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

 
  
 
 
 
 /*1. Program to add two integers and two float numbers. When no arguments
are supplied, give a default value to calculate the sum. Use function
overloading.*/



public class SimpleTesting{ 
    int add(int a, int b) {
        return a+b;
    }
    float add(int a, int b,int c) {
        return a+b+c;
    }
    public static void main(String[] args) {
        SimpleTesting test =  new SimpleTesting();
        int val1 = 10;
        int val2 = 20;
       
         int val3=100;
        
        int result1 = test.add(val1 ,val2);
           int result2 = test.add(val1 ,val2,val3);


        

        System.out.println("int default resutl1 : "+ result1);
        System.out.println(" int resutl2 : "+result2);

      
    }
}