void Parse (ArrayList list) { / / How to get the list according to the type of the incoming elements, then instantiate element (assuming elements have a default constructor) ... }
<-! Baidu Button BEGIN -> more Share to: <-! Baidu Button END ->
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) -> Reply: obj.getClass (). getSimpleName () Or use instanceof to determine the object Reply:
No way, I do not know the function of the type of the list, so you can not use instanceof, List object obj.getClass (). GetSimpleName () returns a ArrayList, not an element of the class name information Reply:
list.get (0) ah, ah like taking Reply:
obj.getClass (). getSimpleName () Or use instanceof to determine the object
No way, I do not know the function of the type of the list, so you can not use instanceof, List object obj.getClass (). GetSimpleName () returns a ArrayList, not an element of the class name information
list.get (0) ah, like this take ah
No way, at the beginning of the list is empty, fill my function is to complete the list of elements. Reply: Why should this design, ah, to find an architect to help you plan the next Reply: Write a json object automatically decomposed into a class module Reply: Essentially get generic type See http://lorry1113.iteye.com/blog/973903 Reply:
essentially get generic type See http://lorry1113.iteye.com/blog/973903
No comments:
Post a Comment