How to refactor variable type in Eclipse?

前端 未结 3 1158
青春惊慌失措
青春惊慌失措 2020-12-09 07:17

I want to refactor code like this:

int x=4;
int y=x;
System.out.println(y);

How can i do this automatically in Eclipse so x\'s type promoti

3条回答
  •  悲&欢浪女
    2020-12-09 07:54

    I don't think you can do this directly using the refactoring tool in Eclipse. However, what you can do is place your cursor over the variable x and hit CTRL + SHIFT + G to find all references in your workspace. This will then allow you to change any dependent references.

提交回复
热议问题