Does each of these style have a name? I only know that the 2nd one is call " Top down" but no idea what the 1st and 3rd style call. Thanks
public class HelloWorldV1 { //main method public static void main(String[] args) { System.out.println("Hello, Virtual World!"); System.out.println("It is a great day for programming."); } }
public class HelloWorldV2 { //print two lines of text public static void printTwoLines( ) { System.out.println("Hello, Virtual World!"); System.out.println("It is a great day for programming.") } //main method public static void main(String [] args) { printTwoLines(); } }
public class HelloWorldV3 { //default constructor HelloWorldV3() { } //print two lines of text public void printTwoLines( ) { System.out.println("Hello, Virtual World!"); System.out.println("It is a great day for programming."); } //main method public static void main(String [] args) { HelloWorldV3 hello = new HelloWorldV3( ); hello.printTwoLines(); } }