create a package packCal in which main class Calculater and you create 4 different class,add,Multi, sub,Div in packAdd,packMulti,packSub,packDiv.These classes can be accessed through Calculator

This program is completed in 5 steps. These steps are :-


STEP 1 :- 

      ------Make Add package and run it------
package packadd;
public class add
{
public void add1(int a,int b)
{
int c=a+b;
System.out.println("the sum is="+c);
}
}

STEP 2 :- 

      ------Make Subtraction package and run it------
package packsub;
public class sub
{
public void sub1(int a,int b)
{
int c=a-b;
System.out.println("the subtraction is="+c);
}
}

STEP 3 :- 

      ------Make Multiplication package and run it------
package packmul;
public class mul
{
public void mul1(int a,int b)
{
int c=a*b;
System.out.println("the multiplication is="+c);
}
}

STEP 4 :- 

      ------Make Division package and run it------
package packdiv;
public class div
{
public void div1(int a,int b)
{
int c=a/b;
System.out.println("the division is="+c);
}
}

STEP 5 :- 

      ------Finally make a  package Calculator and import all  packages and store all packages in same directory and run it------
package packcal;
import packadd.add;
import packsub.sub;
import packmul.mul;
import packdiv.div;
public class calculator
{
public static void main(String...ghj)
{
add a= new add();
a.add1(5,4);
sub b= new sub();
b.sub1(5,4);
mul m=new mul();
m.mul1(4,5);
div d= new div();
d.div1(5,4);
}
}

4 comments:

  1. Awesome work Guys, So here is a best converter which will definitely convert several files;

    File Free Converter

    ReplyDelete
  2. Respect and that i have a swell give: What Is House Renovation house renovation price

    ReplyDelete