how to buildup up the operaters mathmatics multiply and division?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: how to buildup up the operaters mathmatics multiply and division?

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Posts
    2

    how to buildup up the operaters mathmatics multiply and division?

    class Parent{
    protected int x=100;
    protected int y=200;
    public void add(){
    int z=x+y;
    System.out.println("The addition is"+z); }
    }
    class Child2 extends Parent{
    private int a= 10;private int b= 20;
    private void write (){
    int c= a+ b;
    System.out.println("The addition is"+ c);}
    public static void main(String[] arg){
    Child2 c=new Child2();
    c.add();
    c.write();
    c.x=1000;
    c.y=2000;
    System.out.println("Now x is" + c.x);
    System.out.println("Now y is" + c.y);
    }
    }
    class Brother2 extends Parent{
    public static void main(String[] arg){
    Brother2 c=new Brother2();
    c.add();
    c.x=7000;
    c.y=5700;
    System.out.println("Now x is" + c.x);
    System.out.println("Now y is" + c.y);
    }
    }
    please if any gentlemen and ladies here can type sentences as explanation how does the total amout appears according to which step is reqired for compiler to work?
    in other words if(now x is" + c%x);
    if(now y is" + c %y);
    thank you

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    are you asking how to multiply without using the multiplication symbol? Well, that's just recursive addition. And division is subtraction.

  3. #3
    Join Date
    Sep 2005
    Posts
    2
    thank you mr rahec

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center