Program to create a class 'PackageUse' to import the above package 'useFul' and use the method area( )

In previous program, we have crated a package named useFul and added class UseMe in that package. Now in this program we use that package to import the class "UseMe" in class "PackageUse". Here we have used the area( ) method of UseMe class.

import useFul.UseMe;

class PackageUse
 public static void main(String b[])
  UseMe um = new UseMe();
C:\>java PackageUse
Length of Rectangle = 12.0
Breadth of Rectangle = 7.0
Area of Rectangle = 84.0

No comments:

Post a comment