answersLogoWhite

0


Best Answer

That depends on the programming language. In C, and languages derived from C (including Java), you usually declare the return value as "void", for example:

void MyMethod(int par1, int par2) {

// Some commands here

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create methods that does not return a value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you prevent delegate to return any value from all referenced methods?

the return type is void


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.


Investment Appraisal Methods?

The Payback method is one of the investment appraisal methods. Other methods to appraise investments are the Average Rate of Return and the Net Present Value method.


What is factory methods?

Factory methods are merely a convention whereby static methods in a class return an instance of that class. The InetAddress class has no visible constructors. In InetAddress the 3 factory methods getLocalHost, getByName, getAllByName can be used to create instances of InetAddress.


How to create methods in constructor?

You cannot create methods inside a constructor


What two methods of project analysis were the most widely used by CEO's as of 1999?

internal rate of return and net present value


How do you create share holder value?

Shareholder value directly relates to increasing the value of the company through earnings, brand improvement and distributions of profits. To create or increase shareholder value a company needs to increase the direct and intrinsic worth of the company. Ultimately, with the idea to create a return on an shareholder's investment in the company/corporation.


How do you create an algorithm that will read the values of A and B and will determine which has the higher value?

The algorithm can be easily stated as follows: if A is greater than B then return A, otherwise return B.


What is the difference between properties and methods in qtp?

property is like variable (can able to set and get value at runtime) but method is like a function which will return the value at runtime so the only different is property will hold the value untill the new value will set into that.


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 is the correct way to create a function in php?

function myFunction($parameter1, $parameter2) { // this function's code goes here return $returnValue; // the value returned }


What are the advantages and disadvantages associated with Net present value and internal rate of return as methods of investment appraisal?

http://wiki.answers.com/Q/What_are_the_advantages_and_disadvantages_associated_with_Net_present_value_and_internal_rate_of_return_as_methods_of_investment_appraisal pls. what is answer provided for the qustion above