开发者

How to convert from object to String?

How to conve开发者_运维百科rt arraylist selectitem to string.I am getting as object.Please help me...

List<SelectItem> DtlLst = new ArrayList<SelectItem>();
DtlLst.add(new SelectItem(DtlVO.getTrnId(),
                    DtlVO.getTrnId()));
---
---
String number =new String(DtlLst.get(0).toString());
                            System.out.println("number"+number.toString()); 

I am getting as object.How to get this list first value ?


Have you tried implementing the toString method of SelectItem?


Preferrably override toString as @Jim has suggested.

Alternatively you could use ToStringBuilder.reflectionToString(YourObject) although there might be a performance penalty to pay since it is using reflection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜