84.1k views
3 votes
Write (i.e. implement/define/code) a public class MakeHelloWorld that when compiled and executed prints the code for a public class HelloWorld to the standard output stream. The generated public class HelloWorld, when compiled and executed, prints to the standard output stream:

1 Answer

7 votes

Answer:

Following are the code to this question:

public class HelloWorld //defining a class HelloWorld

{

public static void main(String[] ax)//defining maion method

{

System.out.println("Hello, my name is D..");//print message

}

}

Output:

Hello, my name is D..

Step-by-step explanation:

In the above-given java program code, a class "HelloWorld" is defined, and inside the class, the main method is declared that, and inside the main method, the print method is used, that prints a string value.

In this program, inside the main method, it uses a string type class, that helps to prints the string value.

User Emmanuel F
by
4.3k points