开发者

why java don't have default value for arguments in method call

开发者 https://www.devze.com 2023-01-29 04:17 出处:网络
for example with 开发者_开发问答C++ I can write void func(int a=1,int b=2){...} using Java I have to create several methodsIt wasn\'t a feature that the creators of Java thought was important enoug

for example with 开发者_开发问答C++ I can write

void func(int a=1,int b=2){...}

using Java I have to create several methods


It wasn't a feature that the creators of Java thought was important enough to include. Remember that Java was partially created as a reaction against the complexities of C++.

0

精彩评论

暂无评论...
验证码 换一张
取 消