Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Maria Silva   on Jun 08 In Java Category.

  
Question Answered By: Dannon Jones   on Jun 08

I suppose they omitted it because it basically is a form of
method overloading  and would make it confusing ie.

void myTestMethod(int x,int y=1){}

is more confusing than:

void myTestMethod(int x){myTestMethod(x,0); }
void myTestMethod(int x,int y){}

Share: 

 
 
Didn't find what you were looking for? Find more on Why does Java not allow default function arguments ? Or get search suggestion and latest updates.


Tagged: