• Register
0 votes
132 views

Problem:

Write a complete main method that prints Hello, world to the screen?

5 3 2
7,520 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

public static void main( String [] args )
{
System.out.println( Hello, world );

System.exit( 0 );
}

 

Explanation:

A method in object-oriented programming like Java, Python is a procedure associated with a class. A method defines the behavior of the objects that are created from the class. Another way you can say that this is that a method is an action that an object is able to perform. The association between method and class is called binding. Method and a function are the same, with different terms. A method is a procedure or function in object-oriented programming.

6 4 2
14,580 points

Related questions

0 votes
1 answer 177 views
177 views
Problems: I need help in programming to solve my issue. Is there anyone who can help me ? Write a complete main method that prints Hello, world to the screen?
asked Feb 13, 2020 maddi86 5.4k points
0 votes
1 answer 2 views
2 views
Problem: My question is kinda basic, what do we call a constructor ? Can I call it a method? or something else? As a beginner, I have so many questions of the sort. Please answer my question. Thank You!
asked Mar 31 Code Learner 9.2k points
0 votes
1 answer 2 views
2 views
Problem: How can I create a basic C app in Visual Studio, be it 2010 Ultimate or 2008 Professional? I have searched through the project templates, and can find plenty for C++, but none for C.?
asked 3 days ago Sana8989 8.9k points
0 votes
2 answers 3 views
3 views
Do anyone have solution for this how to print hello world without using semicolon in java ?
asked Mar 30 Madhav96 2.3k points
0 votes
0 answers 1 view
1 view
Problem: I am stuck during learning as I have already mentioned in my question someone please cooperate me to continue my project-Thanks
asked Mar 24 rubelkhan 20.4k points
0 votes
2 answers 44 views
44 views
Problem: Given the array a, write an expression that refers to the first element of the array?
asked Apr 12, 2020 ArifulIslam 7.5k points
0 votes
1 answer 25 views
25 views
Problem: Given that play_list has been defined to be a list, write a statement that sorts the list?
asked Mar 9, 2020 ArifulIslam 7.5k points
0 votes
1 answer 43 views
43 views
Problem: Hi there! I am confused in while loops and I need to write a program in which a value is taken as input from the user. If the value is less than 0, the program should increment it by 5 as long as the value remains less than 0. As the value becomes greater than or equal to 0, it should print the number of times the value has been incremented and the final value. Any help??
asked Jan 21 Code Learner 9.2k points
0 votes
2 answers 36 views
36 views
Problem: A function may return a pointer, but the programmer must ensure that the pointer ________?
asked Apr 12, 2020 ArifulIslam 7.5k points
0 votes
1 answer 106 views
106 views
Problem: Which of the following is NOT a rule that must be followed when naming identifiers? A. Identifiers for constants should use an underscore between words. B. Identifiers should use periods to separate words. C. Identifiers should list the data type at the end of the name. D. Identifiers can contain spaces.
asked Mar 9, 2020 ArifulIslam 7.5k points