Method Overloading




















Method Overloading



Figure 1: Method Overloading

The concept of method overloading is used when creating the same method repeatedly in the same class. This can be done by changing the parameter, which is called the method signature.

Figure 2: Method Overloading Example

Access Modifiers

The security which is used to access classes, methods and variables, is called modifiers. there are 4 types of modifiers.

  1. Public
    • Project, class in the project and other related classes can access.
  2. Protected
    • Class, package and sub classes can access.
  3. Default
    • Class and package can access.
  4. Private
    • Only the class can access.

Static

Static is a keyword that cannot be changed but used as a modifier. Variables, methods, classes in a class can be accessed from anywhere in it using the "static" keyword.

Figure 3: static keyword Example



Comments

Popular posts from this blog

Polymorphism

Java Standards, Class & Object

Super Keyword