Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Calling User-Defined Method in Java

class userDefinedMethod
{
static void showMessage() 
{
System.out.println("Static method.");
}
void displayMessage() 
{
System.out.println("Non-static method.");
}
public static void main(String[] args) 
{
showMessage(); 
userDefinedMethod method=new userDefinedMethod();
method.displayMessage();
}
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Calling #Method #Java
ADD COMMENT
Topic
Name
4+7 =