Skip to main content

Posts

Showing posts with the label Static Methods

Static methods

Static Methods | Java: Static methods are having collection of statements to perform particular task. Syntax:                              static void/int method_name(par1,par2,...,parn)                                           {                                                          // statements.                                            } Here is the Code: import java.io.*; class Main { public static void main (String[] args) { A(); B(); print("Hello"); sum(1,2); int a = mult(1, 2); System.out.println(a); } static void A() { ...