Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
1

can someone pls explain what a function is in java cause im new to coding

MatthewXia
MatthewXia

i have no idea. pls help. (but u dont have to if to decide not to)

2 years ago
You are viewing a single comment. View All
1
Coder100
Coder100

For example:

String name = "Coder100"; Console.WriteLine("Hello world"); Console.WriteLine("Your name is "+name);

if you would want to do that a lot of times, at the end, it will be pretty tedious. Using a function will simplify that:

void greet(String name) { String name = "name"; Console.WriteLine("Hello world"); Console.WriteLine("Your name is "+name); } greet("Coder100");
2 years ago
1
MatthewXia
MatthewXia

@Coder100
whats greet

2 years ago
1
Coder100
Coder100

just an example function

@MatthewXia

2 years ago