uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

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 names even 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{
  void test1(){return("hello world")}
  Integer test1(){return("dlrow olleh")}
}



      

Load the above code into UmpleOnline

 

Another Example

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


      

Load the above code into UmpleOnline