Introduction
This blog based on Java Program, without main (). Java is a class-based object-oriented programming language.
Example
- class Math {
- Static {
- int a, b, c;
- a = 12;
- b = 5;
- c = a + b;
- if (c == a + b) {
- System.out.println("a+b\t" + c);
- c = a - b;
- if (c == a - b) {
- System.out.println("a-b\t" + c);
- c = a * b;
- if (c == a * b) {
- System.out.println("a*b\t" + c);
- c = a / b;
- if (c == a / b) {
- System.out.println("a/b\t" + c);
- } else {
- System.out.println("No result");
- }
- }
Create this program in notepad and open CMD and got to the location where your program has save as like suppose desktop then type cd desktop then you see CMD




Krishna Rajput SinghPosted Mar 3, 2016, 7:56 AM
http://krishnasinghprogramming.blogspot.in
Mohan PawarPosted Aug 8, 2014, 1:42 AM
good static block initialize before the main method...
Krishna Rajput SinghPosted Jul 15, 2014, 3:52 PM
very nice