亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

eclipse java debug時的expression
天蓬老師
天蓬老師 2017-04-17 17:40:51
0
1
366

Java新手。我在eclipse里面調(diào)試java代碼時發(fā)現(xiàn)expression這個標(biāo)簽頁并不怎么好用。比如這么一個小程序

public static void main(String[] args) {
        // TODO Auto-generated method stub
        String notion = "{\"name\": \"Bill\", \"age\": 25, \"id\": \"1070329129\", \"friends\":[{\"name\": \"Eric\", \"age\": 30, \"id\": \"12345\"}, {\"name\": \"John\", \"age\": 33, \"id\": \"32154\"}]}";
        
        Gson gs = new Gson();
        
        people p = gs.fromJson(notion, people.class);
        
        
        System.out.println(p.getName());
        System.out.println(p.getAge());
        System.out.println(p.getId());
        List<people> temp = p.getFriends();
        
        for (int i = 0; i < p.getFriends().size(); i++) {
            System.out.println(p.getFriends().get(i));
        }

我在getFriends()那里斷點(diǎn)。在expression標(biāo)簽中輸入p.getFriends(), 提示

"temp.size()" <error(s)_during_the_evaluation>

難道一個變量在運(yùn)行時我想調(diào)用一下它的方法都不行嗎?還是應(yīng)該怎么用?

謝謝。

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~

reply all(1)
劉奇

Your breakpoint is above the temp variable declaration. Of course, the temp variable referenced in the expression at this time does not exist.
If you take two steps down, the expression will have the correct value.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template