write a program where is MyClass calculate()method is available to all the object .and hence every can calculate - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
write a program where is MyClass calculate()method is available to all the object .and hence every can calculate

write a program where is MyClass calculate()method is available to all the object .and hence every can calculate

// Abstraction class
// all object shasring with the same data method
class MyClass
{
  void calculate(double x)
  {
     System.out.println("Square="+(x*x));
}
}
class Common
{
   public static void main(String[]arr)
   {
     MyClass mc=new MyClass();
MyClass mc1=new MyClass();
MyClass mc2=new MyClass();
mc.calculate(3);
mc1.calculate(4);
mc2.calculate(5);
}
}

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.