1

Newbie java programmer here. Is there any way I can view the contents of a class file in the Intelli J idea? Suppose I import a class java.lang.Math.* is there any way I can view the contents of *?

DaCruzR
  • 347
  • 2
  • 5
  • 14
  • double click the class file ? for a class that you don't know where is its class file just right click on the class name and click `Go To Declaration` – niceman Mar 08 '17 at 19:20

2 Answers2

2

For a class file you have, you can just open it in intellij by double-clicking(you may need to import the file if it isn't part of your project).

For a class you're using and you don't know where is its class file, like Math here :

int x=Math.min(2,3);

Just right click on Math word, Go To and then Declaration as shown here : enter image description here

Alternatively you can follow @Faisal's suggestion.

niceman
  • 2,653
  • 29
  • 57
1

Have your cursor on the class name and hit F4. It will direct you to the declaration of that resource.

  • I tried your method dude but it didn't work, just thought of checking the keymap in the ide settings and f4 isn't mapped anywhere. Thanks for your help. – DaCruzR Mar 08 '17 at 21:07
  • @RaynerDaCruz it did work for me, key bindings in general depends on IDE version and settings – niceman Mar 09 '17 at 14:56