Access Modifier : Public

in Hindi - Access Modifier : Public



not yet

Source Code :

RUN<div class="col-sm-12">
<div class="col-sm-6">
<h4>X.java</h4>
<pre>
package xyz; 
public class X{ 

public void show(){
System.out.println("This class name is X");

} 
}</pre>
</div>
<div class="col-sm-6" style="margin-top:-18px">
<h4>Y.java</h4>
<pre>
import xyz.*; 

class Y{ 
public static void main(String args[]){ 
X obj = new X(); 
obj.show(); 
} 
}

Output :
This class name is X
</pre>
</div>
</div>