answersLogoWhite

0

What is the use of the parameter in java?

Updated: 8/19/2019
User Avatar

Wiki User

13y ago

Best Answer

A parameter is a variable that is passed to a method. It is not specific to Java, and is used in almost all programming languages. The parameter is used by the method in whatever way that it wants.

Example:

public void add(int x, int y) {

return x + y;

}

In this case, the parameters are two integers, x and y. They are passed to the method 'add' which returns the sum of the parameters.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of the parameter in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which MATH classs features does not use any parameter or arguments in Java?

The fields Math.PI and Math.E.


What is the purpose of Java Properties?

The Java Properties stores settings and configuration data such as user preferences or connection settings. It stores each parameter as a pair of strings, one being the name of the parameter and the other the value.


What is the main feature of the programming language Java Classpath?

Java Classpath is a parameter that tells the Java Virtual Machine or the Java Compiler, where to search for user-defined classes and packages on a computer.


What happens when you add primitive data type into a collection in java?

how do you get the value of the parameter in the applet


Why and when should programmers use a constant reference parameter?

when we use that parameter as a global parameter and we used that parameter through out the program without changing


Write a program in java to find factorial of a number?

I suggest to use a for loop, more or less like this (assuming the parameter is "n"): product = 1; for (int i = 1; i <= n; i++) { product *= i; }


Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


What is the use of overloading in java?

method overloading is the primary way polymorphism is implemented in JavaOverloading methodsoverloaded methods: appear in the same class or a subclasshave the same name but,have different parameter lists, and,can have different return types


What technologies link to Java?

Java is exclusive to surfing the web. Some web sites use Java to embed videos, others use Java for advertisements.


How do you make a GUI Frame java program?

The best way, in my opinion, is to use the class JFrame in the swing package. Simply import java.swing.JFrame and create a new JFrame with the Frame's title as the sole parameter. You will also need to setVisible to true.


Does Java Script use the same compiler as Java?

No


What you use in case of pointer in java?

Java does not have pointers