Back To Java User Defined Methods Index
//program to demonstrate user defined function,create a function to display hello world on the screen class phello { public void prhello() { System.out.println("Hello World"); } } public class printhello { public static void main(String[] args) { phello ob=new phello(); ob.prhello(); } }