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, 2:56 AM EST
http://krishnasinghprogramming.blogspot.in
Mohan PawarPosted Aug 7, 2014, 9:42 PM EDT
good static block initialize before the main method...
Krishna Rajput SinghPosted Jul 15, 2014, 11:52 AM EDT
very nice