Kartier Pohs

Monday, June 15, 2015

Use of more than one class in a java program.

Use of more than one class in a java program.
Use of more than one class in a java program.
class Room
{
  float len,brd;
  void getdata(float x,float y)
    {
      len=x;
      brd=y;
    }
}
class CalArea
{
  public static void main(String args[])
   {
     float area;
     Room obj=new Room();
     obj.getdata(10,15);
     area=obj.len*obj.brd;
     System.out.println("The area of Room is : " +area);
   }
}
 OUTPUT
Use of more than one class in a java program.

3 comments:

  1. Thanks..I will add a big collection of useful java tutorials ASAP

    ReplyDelete
  2. thus in java programming is really nice and informative thanks for sharing your precious values it will be useful for many others.

    sas training in chennai

    ReplyDelete
  3. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    SAS Training in Chennai | SAS Course in Chennai

    ReplyDelete

Copyright 2015 @ Yogesh Prasad