Is it possible multiple methods with the same name but different parameters in a class?

后端 未结 2 952
悲&欢浪女
悲&欢浪女 2021-01-29 10:23

I\'ve coded in C before, but I\'m completely new to java I\'m doing a tutorial for my OOP class, and this is pretty much my first time officially learning the language

I

2条回答
  •  后悔当初
    2021-01-29 10:56

    Method overloading (or Function overloading) is legal in C++ and in Java, but only if the methods take a different arguments (i.e. do different things). You can't overload in C.

提交回复
热议问题