Bound mismatch error and java generic method

前端 未结 5 1534
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 00:32

I am getting the following error:

Bound mismatch: The generic method constructPage(WebDriver, int, Class) of type     
Page is not applicab         


        
5条回答
  •  既然无缘
    2021-01-06 00:44

    If you still wish HomePage to extend SecuredPage with the presence of Bounded Generics, please pass the 'Generic Substitution' till HomePage.

    Do not substitute Generic at SecuredPage, instead make SecuredPage as

    public class  SecuredPage> extends Page {
    
    }
    

    and while creating HomePage, declare the value for the generic like this,

    public class HomePage extends SecuredPage {
    
    }
    

    This should essentially solve the error

提交回复
热议问题