Solved

checked and unchecked exception

Posted on 2014-02-04
6
286 Views
Last Modified: 2014-02-18
Hi,

I am working on below example

http://www.avajava.com/tutorials/lessons/whats-the-difference-between-a-checked-and-an-unchecked-exception.html?page=1


When i try to run this example I am getting compilation error at the CheckeException and UnCheckedException.

How to fix these errors.

Also as given in the link How to see the Hierarchy view (in my eclipse i see call Hierarchy, Data Hierarchy, Tyoe Hierarchy etc none of them dipslay what I want, what is the difference between above Hierarchies) in the eclpse so that i can see Object--->Throwable--->Exception(orRuntimeException to Unchecked)---->CheckedException


please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
  • 3
  • 2
6 Comments
 
LVL 14

Expert Comment

by:CPColin
ID: 39834126
Please paste the compilation error you're seeing.
0
 
LVL 6

Assisted Solution

by:Mahesh Bhutkar
Mahesh Bhutkar earned 200 total points
ID: 39834935
To See the class hierarchy inside eclipse,
Just select the Classname from editor & press ctrl+T.

You can check the views also from eclipse tools menu for seeing the hierarachy.

Please provide exception that you are getting.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39843042

Also as given in the link How to see the Hierarchy view (in my eclipse i see call Hierarchy, Data Hierarchy, Tyoe Hierarchy etc none of them dipslay what I want, what is the difference between above Hierarchies) in the eclpse so that i can see Object--->Throwable--->Exception(orRuntimeException to Unchecked)---->CheckedException

cntrl+T showed a popup to see the Hierarchy. But how to see that in a physical view rather than disappearing pop up? please advise
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 14

Accepted Solution

by:
CPColin earned 300 total points
ID: 39843061
Go to the menu bar and click "Window / Show View / Other." Then expand "Java" and select "Type Hierarchy." Now you can drag things like packages and classes into that view and see their hierarchies.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39857411
I enabled Type Hierarchy.


How do i drag let us say Exception class to see its Hierarchy. I am not able to drag and drop. Please advise with screenshot if possible
0
 
LVL 7

Author Comment

by:gudii9
ID: 39867885
I see i have to enable  "Type Hierarchy." as below

Go to the menu bar and click "Window / Show View / Other." Then expand "Java" and select "Type Hierarchy."

Then i have to go to my java file in eclipse go to the line below

public class Test {

      public static void main(String[] args) throws IOException {


select IOException  and right click and see option Open in Type Hirerachy or F4 and see on the left hand side the expanded hierarchy displayed.
TypeHierarchy2.jpg
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question