What is a void method java?



What is a void method java?..

Answer / Kuldeep Kumar Azad

A `void` method in Java is a method that doesn't return any value. It may still perform some actions, such as printing output or updating variables, but it doesn't return a result.nnExample:n```javanpublic void printMessage() {n System.out.println("Hello World!");n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is class forname used for?

1 Answers  


Which browsers work with java?

1 Answers  


What restrictions are placed on method overriding?

1 Answers  


What is static synchronization?

1 Answers  


Java is Pass by Value or Pass by Reference?

1 Answers   BirlaSoft,


What is a blocking method in Java?

1 Answers  


Can an interface extend another interface?

1 Answers  


Which non-unicode letter characters may be used as the first character of an identifier?

1 Answers  


What is the purpose of extern variable?

1 Answers  


What is Difference between Serializable and Externalizable in Java serialization?

1 Answers   Cognizant, IBM,


Why cant we define System.out.println() inside a class directly?

5 Answers  


What is difference between equals and hashcode method?

1 Answers  


Categories