Avatar of gudii9
gudii9
Flag for United States of America asked on

eclipse shortcuts

Hi,
what are eclipse shortcuts for


how to extract some code to separate metod
how to put in a loop sysout

how to move whole method up and down

how to find call hierarchy and how it is different from type hierarchy and find references

please advise
* EclipseJavaJava EEEditors IDEs

Avatar of undefined
Last Comment
gudii9

8/22/2022 - Mon
Am P

how to extract some code to separate metod
Unable to understand this. Explain in detail.

how to put in a loop sysout
Unable to understand this. Explain in detail.

how to move whole method up and down
Never needed to move a method from one place to another in the same class. If this is the problem, any specific reason to do so. By the way you can copy entire block and drag it to wherever you want to place it.

how to find call hierarchy and how it is different from type hierarchy and find references
Call hierarchy gives details about the method call. That is from how many places your method is being invoked.
Type hierarchy gives details about the parent class of the selected type as well as child classes for the same.
Find reference 1. In workspace, select the variable and press Ctrl+Shift+G, In project or hierarchy, select the variable then right click References -> your choice.
gudii9

ASKER
how to extract some code to separate metod
Unable to understand this. Explain in detail.

sorry for long time on this.


say i have 1000 lines of code in a method called MethodA. I want to move first 500 lines of code to MethodB.how to create new MethodB by extracting those first 500 lines of code automatically using eclipse? please advise
gudii9

ASKER
how to put in a loop sysout
Unable to understand this. Explain in detail.

sysout i mean to say System.out.println("aaaa")
Your help has saved me hundreds of hours of internet surfing.
fblack61
gudii9

ASKER
Call hierarchy gives details about the method call. That is from how many places your method is being invoked.
Type hierarchy gives details about the parent class of the selected type as well as child classes for the same.
Find reference 1. In workspace, select the variable and press Ctrl+Shift+G, In project or hierarchy, select the variable then right click References -> your choice.

when to use which one?
Am P

say i have 1000 lines of code in a method called MethodA. I want to move first 500 lines of code to MethodB.how to create new MethodB by extracting those first 500 lines of code automatically using eclipse? please advise

You will have to do it manually. B'caz, we, the developers, are aware about the logic, code and how much snippet needed to extract. In my professional career, I used to re-factor the code (you example, method with 1000 lines divided into 5 or more), but all is manually. No IDE for that.
gudii9

ASKER
any good videos on eclipise shortcuts and better usage of those functions?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
as we spend long time on debug once we know how to better debug it will be easy right?
gudii9

ASKER
class A has methodA which is callign Class B's methodB

now i clicked on methodB of ClassB and said call hierarchy
surprisingly it did not show  class A methodA in call hierarchy? why
gudii9

ASKER
any good screenshots or tutorials with pictures to understand this with working examples?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
Am P

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
Find reference 1. In workspace, select the variable and press Ctrl+Shift+G, In project or hierarchy, select the variable then right click References -> your choice

what is the use of references option?
what is difference between project reference and work space reference?