Skip to content

Commit

Permalink
Update test.java
Browse files Browse the repository at this point in the history
using the variable initilization in the private mehtod as an arugment variable 's'.
So, this are the method access modifiers.
  • Loading branch information
sachinbhujbal authored Dec 19, 2021
1 parent d3ef12d commit e27f385
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Access_modifier/test.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
package Access_modifier;

public void display(){
System.out.println("This is display method");
}
private void display2(int s){
System.out.println("This is display2 method"+s);
}
protected void nothing(){
System.out.println("this method return nothing");
}

public class test {
public static void main(String[] args) {
A a = new A();
a.display();
a.display2();
a.display2(34);
a.nothing();
}
}

0 comments on commit e27f385

Please sign in to comment.