list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

W049 Duplicated Method Name

Umple semantic warning reported when two methods have the same names and return types

You cannot have two methods that have the same names and return types. 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");}
  String test1(){return("dlrow olleh");}
}
      

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 test1(){}
  void test2(){}
}
      

Load the above code into UmpleOnline