Tuesday, 15 May 2018

Java function variables with default value

I have some function in java and i want this function to have a parameter with a default value that is set to variable if no value sent, look like following:



private void test(int count=5)
{

}


So i can call the function with 2 ways:
test(); and test(10);

how do i do it?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...