What is public and private method in Java?

public means you can access it anywhere while private means you can only access it inside its own class . Just to note all private, protected, or public modifiers are not applicable to local variables in Java. a local variable can only be final in java.

Sizin İçin Seçtik  What are parameterized constructors explain with a C++ program?

Leave a Reply

Your email address will not be published. Required fields are marked *