answersLogoWhite

0


Best Answer

// This method will accept an integer, double, and string as parameters

// To invoke it, simply call testMethod(0, 1.1, "hello");

// (or whatever values you wish to substitute in)

void testMethod(int param0, double param1, String param2) {

System.out.println("Accepting parameter: " + param0);

System.out.println("Accepting parameter: " + param1);

System.out.println("Accepting parameter: " + param2);

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write and invoke methods that take parameters?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the uses of h parameter?

h parameters are the two port parameters , a two port parametres has two ports or four terminals two for input and two for output. In general the convention is to take current at both input and output ports into the network.for a linear network (passive elements like current source, voltage source and resistors donot change their value during the performance of circuit), we can write the voltage and current as a linear funcion of input and output parameters. especially these h-parameters are widely used in electronics cirtcuits rather than electrical circuits , the major advantage of these is we need not follow the whole tedious procedure again and again to calculate the input and output parameters just by knowing the h-parameters these values are found by direct substitution , hence one can save a lot of time by using these parameters and we come across different errors while calculation of the output parameters, if we use these h parameters only one confident and neat calculation is sufficient


How much force does it take to bend 10' 3.625 steel rod?

This sounds like a homework question. Hint, define your parameters, and ask where the force is applied.


Define the event in visual basic?

Visual Basic is an event driven program. For an example, take a button on a Windows Form. When you click on the button, it is an event. That event invokes a method and executes a part of the program. A Scroll bar have events scroll and change. When you scroll the scroll bar, it is an event for the scroll bar. When you click on a position on the scroll bar, the value changes at one and it is another event. These different events can invoke different methods.


How do you write leave application for Exam?

You don't. Take the exam or don't take the exam, but you don't ask for "leave".


Where do c plus plus begin execution?

C++ begins its execution at int main(...parameters...) or int WINAPI WinMain(...parameters...). WinMain() is used in Win32 programming, for windows, message boxes etc. main() is used in console programming.int main() either have no parameters ( int main()) or it can have two parameters ( int main(int argc, const char* argv[]) ). int argc is the argument count, and const char* argv[] is the argument vector (the values of the arguments). These parameters are only useful if you need to take arguments from the user when you start up the application.int WINAPI WinMain() must have four parameters. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdParam, int nCmdShow). WINAPI is a method of passing parameters which comes from the days of Fortran and Pascal. It reverses the order the parameters are passed. Why this is necessary is not important WINAPI is simply required by Windows. HINSTANCE hInstance is a handle (a pointer) to the current application instance. HINSTANCE hPrevInstance is a handle to the previous instance. In theory, if there are multiple copies of an application open, then this would point to the last one created. LPSTR lpCmdParam is a long pointer to the command line calling existence to the application. If you were to open, let's say, "MyWin32App.exe" then this would be what lpCmdParam is pointing to. If you were to open "MyWin32App.exe -StartFullscreen" then that would be what it is pointing to. int nCmdShow is the parameter indicating how the window should be opened. You could start the application minimised, maximised etc.References:http://www.directxtutorial.com/Tutorial9/A-Win32/dx9A2.aspxhttp://en.wikipedia.org/wiki/Main_function_(programming)#C_and_C.2B.2B

Related questions

Write about the method of undetermined coefficients and method of variation of parameters Discuss and compare the advantages and disadvantages of each method Illustrate your findings with examples?

As long as you give me the marks and you take none yourself I may consider doing such writing.


Why do scientists make a rely on models?

Because there are too many parameters in real life to take into account.


What are the uses of h parameter?

h parameters are the two port parameters , a two port parametres has two ports or four terminals two for input and two for output. In general the convention is to take current at both input and output ports into the network.for a linear network (passive elements like current source, voltage source and resistors donot change their value during the performance of circuit), we can write the voltage and current as a linear funcion of input and output parameters. especially these h-parameters are widely used in electronics cirtcuits rather than electrical circuits , the major advantage of these is we need not follow the whole tedious procedure again and again to calculate the input and output parameters just by knowing the h-parameters these values are found by direct substitution , hence one can save a lot of time by using these parameters and we come across different errors while calculation of the output parameters, if we use these h parameters only one confident and neat calculation is sufficient


How many senate members does it take to approve the cloture rule?

Cloture already exists in the US Senate. It takes 60 Senators to invoke Cloture.


How do you write take before bed in a prescription?

You write it like this, "Take before bed."


What is ment by methodical records?

Methodical methods in a lab setting means making sure you write down every thing you do, constantly record observations of anything you are working with, and take notes of how much of everything you use is and how much you yield.


Where is the paint code on a 1997 Catera?

it is on the vin label, where you have the tire size parameters, you can take ti to a auto color supply and they will help you, decyphering it.


How do you remove the speed limiter to a 1999 Volvo fh12?

You take it to a Volvo Dealer and they plug in a laptop and reprogram some parameters on the ECU in the truck.


The methods humans use to take care of soil?

acid prepriation


Can you take private methods and final methods as same?

Yes, a method which is declared as private is inaccessible to subclasses, and can thus be thought of as final, as well.


What is a default parameterized constructor?

There is no such thing as a default parameterized constructor. The default constructor is always the 'no-arg' constructor and does not take any parameters or arguments as input


Various methods used for evaluating investment proposals?

It is important to use various methods for evaluating investment proposals. Some methods you can use is to research what the investment is currently worth, and how long it will take to mature. Take this information to help you determine if your money would be better used in other ways.