1. Array objects are by default type-safe. i.e if we declare String array, we can insert only String Objects.
  2. By mistake if we are trying to insert any other elements we will get compile time error.

    http://somadesign.com.mx/?komirok=valutahandel-app valutahandel app String [] s = new String[100]; s[0] = "Java"; s[1] = 10;//Compile time error.

  3. But Collection objects are not type safe by default.
  4. If our requirement is to add only String objects to the ArrayList,By mistake if we are trying to insert any other element we won’t get any compile time error.

    http://monster-tamer.com/?pokrova=%D8%AA%D8%AF%D8%A7%D9%88%D9%84-%D8%B9%D9%86-%D8%B7%D8%B1%D9%82-%D8%A8%D9%8A%D8%AA-%D8%A7%D9%84%D8%AA%D9%85%D9%88%D9%8A%D9%84-%D8%A8%D8%A7%D9%84%D8%B0%D9%87%D8%A8&cb3=e2 تداول عن طرق بيت التمويل بالذهب ArrayList l = new ArrayList(); l.add("Java"); l.add(new Integer(10)); //No Compile Time Error

  5. While retrieving Array elements there is no need to perform typecasting.

    التداول في اسهم البنوك String name = s[0];//No typecasting required here.

  6. But while retrieving the elements from ArrayList compulsory we should perform typecasting.

    مواقع تحليل الاسهم السعودية String name = l.get(0); //Compile Time Error String name = (String)l.get(0);

فوركس باللغة العربية

  1. If we want to create ArrayList object to hold any String Objects we have to define as follows.

    ArrayList<String> l = new ArrayList<String>();

  2. For the above ArrayList,we have to add only String objects. By mistake if we r trying to add any other type we will get compile time error.

    http://spaplaceinc.com/dimension-one-spas/embed/ فوركس كوم l.add("valid"); l.add(new Integer(10));//Compile Time Error: //can't find the symbol add(Integer)

  3. At the time of retrieval no need to perform any typecasting.

    مؤشر سوق الأسهم السعودية String name = l.get(0);// No typecasting is required.

  4. Hence by using generics we can provide type safety and we can resolve typecasting problems
  5. By using generics we can define parameter for the collection. These parametrized collection classes are nothing but “ بيع اسهم اكتتاب الاهلي Generic collection classes“.
  6. Polymorphism concept is not applicable for the parameter type but applicable for base type.

    http://www.homelesshounds.org.uk/?mikstyra=%D8%AA%D8%AC%D8%A7%D8%B1%D8%A9-%D8%B3%D8%A8%D8%A7%D8%A6%D9%83-%D8%A7%D9%84%D8%B0%D9%87%D8%A8-%D9%81%D9%8A-%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A%D8%A9&0e5=72 تجارة سبائك الذهب في السعودية List<String> l = new ArrayList<String>() List<object> l = new ArrayList<String>(); /*Compile Time Error: Incompatible Types Found:ArrayList<String> Required :List<Object> */

  7. The type parameter must be object type(any class or interface name).We can’t apply generic concept for primitive data type.

    تعلم شراء وبيع الذهب ArrayList<int> l = new ArrayList<int>(); /*Compile Time Error: unexpected type found : int Required : Integer */