2

Here is a small sample:

public class LocalClassSample {
    public static void main(String[] args) {
        class Utils {
            public void printHello(String name) {
                System.out.println("Hello " + name);
            }
            public String outHello(String name) {
                return "hello " + name; 
            }
        }

        Utils util = new Utils();
        util.printHello("World");
    }
}

I put a break point at the last line. I am able to view util in the Variables window...

enter image description here

I try to view the same variable in the expressions window...it is unable to evaluate:

enter image description here Update:

Even tried inspecting the variable in the Display View...it does not evaluate: enter image description here

1
  • Try moving the Utils class outside of main? Commented Feb 26, 2015 at 14:55

1 Answer 1

0

Expression eval a java expression like 'util.printHello("World")' and return the result ("Hello World"). 'util' is not an 'expression' but just a variable name, if you want to inspect it, use the Variables view or the Inspect command.

Sign up to request clarification or add additional context in comments.

2 Comments

Same issue there too...I cannot inspect...updated that issue in question
it seems like Eclipse does not have visibility of an inner class using the Inspect command. If you externalize Utils class, you should be able to inspect 'util' variable!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.