Close
Close

programming

   zayn_attitude

Create two user defined packages named MyPack1 and MyPack2. Create one class named Area under MyPack1. Area class contains variables global1 and global2. global1 is static in nature. Both the variables are public in nature. Consider global1=500 and global2=100. Area class also contains a static method named area() which is also public in nature. Define the area() method for calculating area of a circle. Create another class under MyPack2. Name this class as CallingClass. Access the variables global1 and global2 of Area class from CallingClass (You can print the variables only inside CallingClass) and also invoke method area() from CallingClass. Write a java program to achieve the above objectives.


Answers

Ask Yours
Post Yours
Write your answer