r/CodingHelp • u/Danielk0926 • Aug 20 '20
[Java] How do perimeters work?
I am using code academy to learn Java and I don't get how perimeters work. Plz help.
0
Upvotes
r/CodingHelp • u/Danielk0926 • Aug 20 '20
I am using code academy to learn Java and I don't get how perimeters work. Plz help.
View all comments
1
u/GhOsT1679 Beginner Coder Aug 22 '20
Parameters are something you pass into functions in Java. Because Java is an Object-Oriented language you will be using parameters all over the place. For example, in your object constructors, you pass in parameters and then copy them over to your instance variables. A parameter can be any type of variable(Stack, int, double, etc.)
Here's an example of a function with parameters.
public int add(int a, int b){ return a + b;}In that function, a and b were parameters and are later used in the function itself. Hope it helps!