0
IN the below program why we are not using public
class MyClass { static int sum(int val1, int val2) { return val1 + val2; } public static void main(String[ ] args) { int x = sum(2, 5); System.out.println(x); } }
1 Odpowiedź
+ 5
You don't have to write any access modifier, by default Java methods have package private scope