Showing posts with label static initialization block. Show all posts
Showing posts with label static initialization block. Show all posts

Thursday, December 05, 2013

Java Application without a main method

Can you write a java program which does not have main but it should be executable with out any errors and exception?

Think for a while before read this post....


Yes, You can write a runnable java program which does not have main method at all. This can be done using the static block of the class.

Tha 𝗔𝗣𝗜 Design 𝗛𝗮𝗻𝗱𝗯𝗼𝗼𝗸

 Here is the 𝟮𝟬𝟮𝟲 𝗔𝗣𝗜 𝗛𝗮𝗻𝗱𝗯𝗼𝗼𝗸 broken down by architecture: 𝟭. 𝗧𝗵𝗲 "𝗥𝗲𝗾𝘂𝗲𝘀𝘁-𝗥𝗲𝘀𝗽𝗼𝗻𝘀𝗲" 𝗧𝗿𝗶𝗼: ...