Eclipse 3.1 in the experience of seven new J2SE 5.0 (1)

  Abstract: Experience in the Eclipse 3.1 new features seven J2SE 5.0 (1) 

  <table CellSpacing=0 cellPadding=0 border=0 class="zh114" align="right"> <tr> <td> </ td> </ tr> </ table> 


  Figure 3.2.1 use of wizard-like creation Fan 

  Eclipse use interface wizard interface to create Fan 


  Figure 3.2.2 use interface wizard type interface to create Fan 

  3.2.4 Fan method parameter types (type parameter) can be used to not only voice or Fan Fan-type interface, can also be used to sound FAN method, but this method Fan statement can be used in non-FAN - category, Fan acoustic method is the general format of the list Fan method 3.2.5 The general form of return-type method-name (parameter-list) () 

  Fan 3.2.6 list of examples method public String getString (T obj) ( 
  Return obj.toString (); 
  ) 

  3.2.5 limited-limited Fan Fan-type parameter is the value range is limited. 

  Keywords can be used to not only extends the statement of the inheritance relations, and also can be used to type the statement parameters (type parameter) of the restriction.    For example, we only need a list of digital storage, including integer (Long, Integer, Short), the real (Double, Float), can not be used to store other types, such as String (String). 

  In other words, should the value type parameter T-Fan extremely limited subclass of Number, in which case, we can use the keyword extends type parameters (type parameter), which limits the number. 

  Fan 3.2.7 limited list of examples of public class Limited ( 
  Public static void main (String [] args) ( 
  Limited number; / / correct Limited str; / / compile errors) 
  ) 

  In Eclipse 3.1, in the case of the compiler error message as shown below 


  Figure 3.2.3 due to limited Fan-led compile errors 

  3.3 in the procedures used in the procedure 3.3.1 Fan-Fan-type used in the creation of the Fan-type object, and the creation of similar basic ordinary objects, there must be a specific type of alternative type parameter T (J2SE 5.0 is not currently support the original type as a parameter type (type parameter)). 

  List 3.3.1, the use of norm-type / / If you need a list of cosmetic GenList integerList = new GenList (); 
  / / If you need a list of character GenList strList = new GenList (); 
  / / Can not use the original type GenList nList = new GenList (); / / Compiler 3.3.2 using the wrong type of Fan-solving security issues Fan-use list is to achieve the type of security, the following statement will undermine security in the type of compiler they can check out.    The mouse on the wrong marker, in the Eclipse 3.1 error message will appear, as shown below: 
  <table Width="96%"> <tr> <td background="http:///images/dian.gif" height="3"> </ td> </ tr> </ table> 

  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags:

Releated Java Articles

Comments

Leave a Reply