answersLogoWhite

0


Best Answer

void

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: The keyword indicates that a method does not return a value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does a void method do?

In Java, this keyword is used to specify that the method has no return value.


What is the return keyword in Java?

this is the type of the value that the method returns to its caller


What is the meaning of java void keyword?

The void keyword is used to show that a method will not return a value. // no return type public void setX(int x) { this.x = x; } // returns an int public int getX() { return x; }


Void in java?

Void is a keyword in Java. It is always used in method declarations. When used in the line that declares a method, it signifies the fact that the method will not return any value. The JVM will not expect the method to return anything. Ex: public static void main(String[] args) {}


Difference in using a method that return value and method that does not return value in object orinted programming?

A method that return a value should have a return statement. The method signature should indicate the type of return value. While in the case of a method that does not return a value should not have a return statement and in the signature, the return type is void. When using a method that doesn't return a value, a programmer can not get a value from that function, but instead, it can only change variable values and run other methods.


Which Keyword is used to return some value from a function?

return var_name; e.g int fun() { int x=...; return x; }


What is wrong with not writing a return statement in value-returning method in java?

It is a syntax error, because a value returning method must return a value, and not writing a return statement with a value is tantamount to returning without a value.


What is the purpose of the keyword void in a function declaration?

when we declare any function with void,it doesnt return any value


Why use void in main of java?

No. void is not a data type. It is mandatory for all java methods to return something and if it is not going to return anything, we have to mark the method with a "void" return type to let the JVM know that it must not expect anything from the method.


What are getters and setters method?

Getter method: A getter method have its name start with 'get', and take 0 parameters, and also returns a value. Setter method: A setter method have its name start with "set", and takes 1 parameter. Setters may or may not return a value. Some setters return void, some the value set.


What value is return by int main method?

1. A method declared as "int" returns an int value. 2. The main() method in Java is not declared as "int", but as "void", meaning it returns no value.


What happens if a final keyword is applied to identifier?

The final keyword indicates that a variable (identifier) can not change his value. In case the variable refers to a reference variable (an object) the values of variables inside (the object) can change but the reference can be reassigned (to another object).