Strange autogenerated getter and setter in eclipse

前端 未结 3 1410
慢半拍i
慢半拍i 2021-01-18 18:35

When I use the auto generation for getter/setter in Eclipse for an class field with a name like
String lAttr it will produce this:

public St         


        
3条回答
  •  自闭症患者
    2021-01-18 18:46

    What version of Eclipse are you using? I tried this in Eclipse 3.5.2, and when I moused-over the field and clicked "create getter and setter for 'lAttr'", the dialog box that appeared allowed me to change the generated names, in this case from getlAttr to getLAttr and setlAttr to setLAttr. Another option would be to just name your field LAttr from the start and avoid the whole mess.

提交回复
热议问题