Function is very Important term in Programming . Functions Could be use in your code multiple time which save your time and key-stokes a lot .In this Small and Simple Code we just tell you that how can you make a Function in Java and use it.
Source Code
import java.util.Scanner; public class Function { public static void main(String[] args) { int x,y,z=0; Scanner s = new Scanner (System.in); System.out.println("Enter 1st Number "); x = s.nextInt(); System.out.println("Enter 2nd Number"); y = s.nextInt(); z = multiplication (x,y); System.out.println(z); } static int multiplication (int a, int b) { return (a*b); } }
a very good and unique way you adopt in coding ....specially the screen shoots of the program output
ReplyDeleteSnipping Tools :)
ReplyDelete