Java program for static methods and static variables on November 15, 2021 Get link Facebook X Pinterest Email Other Apps class Circle { static float PI = 3.1415f; static float area(float radius) { return PI*radius*radius; } public static void main(String ar[]) { int r = 4; float area = Circle.area(r); System.out.println("Area : "+area); }}OUTPUT Comments
Comments
Post a Comment