answersLogoWhite

0

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

12y ago

What else can I help you with?

Related Questions

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

the return type is void


Why is it that void methods cannot return a value?

Void methods in programming are designed to perform a task or operation without returning a value. This is because the purpose of a void method is to execute a set of instructions or actions, rather than to produce a specific result that needs to be returned. Therefore, void methods do not have a return type and cannot return a value.


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 can you handle a situation where you cannot return a value from a method with a void result type?

In a situation where you cannot return a value from a method with a void result type, you can use other methods such as setting a global variable or using output parameters to pass the value back to the calling code.


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 to create methods in constructor?

You cannot create methods inside a constructor


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.