Answers for "File names and Class names in Java"

0

File names and Class names in Java

class Triangle {
            int x, y;
            void printArea()
            {
                        System.out.println("Area of triangle is: " + x * y / 2);
            }
}
class Demo {
            public static void main(String args[])
            {
                        Triangle t = new Triangle();
                        t.x = 10;
                        t.y = 13;
                        t.printArea();
            }
}
Posted by: Guest on April-17-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language