In java below 1.7version, Without writing main method & static block is it possible to print some statements to the console?How? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

In java below 1.7version, Without writing main method & static block is it possible to print some statements to the console?How?

27th Jul 2019, 3:12 PM
sunnym_97
sunnym_97 - avatar
2 Answers
+ 1
You always need a main method when writing a Java program. Otherwise, the compiler won't know where it begins.
29th Jul 2019, 7:08 AM
Frenchtoast
Frenchtoast - avatar
+ 1
Frenchtoast u r right but this rule is applicable only for java 1.7 versions & above but not for below 1.7v
29th Jul 2019, 10:26 AM
sunnym_97
sunnym_97 - avatar