Static Function Example in Java


Here is the simple program for printing basic example using Static Function in Java.

Source Code

import java.io.*;
import java.util.Scanner;
//www.tutorjoes.com
class static_mem
{
  public static void main(String args[])
  {
    System.out.print("\nMultiply : "+maths.mul(10,25));
    System.out.print("\nDivision : "+maths.div(100,2));
  }
}
class maths
{
  static float mul(int x,int y)
  {
   return(x*y);
  }
  static float div(int x,int y)
  {
   return(x/y);
  }
}
To download raw file Click Here

Output

Multiply : 250.0
Division : 50.0


Learn All in Tamil © Designed & Developed By Tutor Joes