funtion in funtion java code example
Example 1: how to create a function in java
package com.company;
public class Main {
static void one(){ // youCanPutWhatEverNameYouLikeInThePlaceOf"One"
System.out.println("HELLO");
}
public static void main(String[] args) {
one(); //theTerminalShouldSay"HELLO"
}
}
Example 2: function in java
public class Main
{
static void function(){
System.out.println("I am a function!");
}
public static void main(String[] args) {
function();
}
}