Question

Which is correct way to write methods in java?

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.
A public void sayHello()
B public void sayHello
C public void 4sayHello()
D public void sayHello{}
E None of these
Practice Next

Hey! Ask a query