Question

    Read the below passage and answer the questions Java is a most popular, object-oriented, widely used programming language and platform that is utilized for Android development, web development, artificial intelligence, cloud applications, and much more. In Java programming, the ______(19)_____  statement is used for returning a value when the execution of the block is completed. Access modifiers help to restrict the scope of a class, constructor, variable, method, or data member.

    Which is correct way to write methods in java?

    A public void sayHello() Correct Answer Incorrect Answer
    B public void sayHello Correct Answer Incorrect Answer
    C public void 4sayHello() Correct Answer Incorrect Answer
    D public void sayHello{} Correct Answer Incorrect Answer
    E None of these Correct Answer Incorrect Answer

    Solution

    The correct answer is A

    Practice Next