list of dots

User Manual    [Previous]   [Next]   

W071 Duplicate Method Different Type

Umple sematic warning reported when two methods have the same names but different types

In some programming languages like Java, you cannot have the same method name for multiple methods even if the return types are different. The warning is shown to notify the developer of the potential mistake.

Example

// This example generates the message
class A{
  String test1(){return("hello world");}
  int test1(){return(1);}
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// The following shows how to avoid the message.
class A{
  void test2(){}
  Integer test1(){}
}
// @@@skipcompile no return from test1

      

Load the above code into UmpleOnline