Comment

Sam
Generics,
September 7, 2010 at 9:16 PM

Can anyone explain me the meaning of following code fragment?

List <? extends Number > lst = new ArrayList<Integer> ();


I know the meaning of <? extends Number> but I feel like it is an unsafe declaration. If it is so, when is it unsafe? When retrieve things or when add things? What can we add to this ArrayList? Only Integers or any object that extends Number? What do we get out when we retrieve an object from this list? I know it was a passage but someone pelase help in detail.

Thanks A Bunch
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

eraser type generics in java
eraser type generics in java  Explain eraser type generics in java with example 

Java Beginners

generics - Java Beginners
generics  simple notes on Generics as well some programmes, with its added advantages for java...  Hi Friend, If you want to take... this situation Generics provides a way to communicate the collection type 

Core Java

Java Generics
.style1 { list-style-type: square; } Java Generics The Generics.... In general words, Generics allows us to create a single method for sorting... defined types. Generics permits us to catch the incompatible types during 

Core Java

Wildcards in Generics
Wildcards in Generics In this section, you will learn the use wildcards or wildcard character in Generics. Problem : For better understanding of wildcards... in Generics. Solution : Now, the solution of above problem is : List<?> obj 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Beginners

Generics
 

Java Interview Questions

java - Java Interview Questions
java  What is the purpose of Generics in collection?   Hi I am sending a link where you can find details about generics/collection...;Generics provides a way for you to communicate the type of a collection 

Java Interview Questions

Java - Java Interview Questions
Java  How to implement Generics Concept in programs?  Hi When you take an element out of a Collection, you must cast it to the type...(); ) if (((String) i.next()).length() == 4) i.remove(); } Generics 

Java Interview Questions

java - Java Interview Questions
between jdk 1.4 and jdk1.5 in Java?  Difference between jdk 1.4... framework better. They also added more features such as Generics, Annotations any many more. Generics made the collection framework to store the objects 

Java Interview Questions

help needed - Java Interview Questions
help needed  What are the new features added in jdk 1.5?  Hi friend, The following were the new features added in java 1.5. * Generics * Enhanced for loop * Metadata * Static import * Typesafe enums 

Java Interview Questions

Java - Java Interview Questions
Java  Questions on Java 

General

Generics Method in Java
Generics Method in Java     ... it as return type.         Code for Java Method - Generics... and use generic methods in Java programming language. As you already know, generic 

Java Interview Questions

JDK 1.5 Features Diff - Java Interview Questions
JDK 1.5 Features Diff   Hi Frieds , Can u explain me d difference bn Generics and Autoboxing in jdk 1.5.  Hi Generics?Provides compile-time type safety for collections 

Java Tips and Examples

Java Notes: Generics
Java Notes: Generics Using predefined generic classes is commmon, writing... exampleSame example using generics // Typical Collections usage before Java 5... Machine) implementations, Java's generics are only seen by the compiler 

Programming Questions

Software Questions and Answers
- Ask your questions about securing your applications. Java... the answers of the questions asked. JavaMail - Java API to send... questions here. Java Interview Questions - Discuss Java 

Programming Questions

Software Questions and Answers
about securing your applications. Java Server Faces Questions... from within Java program. JMS - JMS questions and answers.... Java Interview Questions - Discuss Java Interview Questions here 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
questions  what is emp table?? can u say what are the number 1 books for refering to java 

Java Beginners

questions
data members b) static methods In our java programming language we have... methods. Methods and Variables in Java In our java programming language we have 2... Instance methods in java must be accessed with respect to object name. Ex. object 

Programming Questions

Questions and Answers Help
Questions and Answers Help      ... features of the questions posting form You can ask questions in and provide...://www.roseindia.net/answers/viewqa/Java-Beginners/11976-Java-Hello-World-code 

Programming Questions

Questions and Answers Help
Questions and Answers Help      ... features of the questions posting form You can ask questions in and provide...://www.roseindia.net/answers/viewqa/Java-Beginners/11976-Java-Hello-World-code 

Java Interview Questions

collection frame - Java Interview Questions
collection frame   starting from jdk1.0 to jdk 1.5,what are the feature s added in each version of collection frame up to jdk1.5 .  Hi friend, (1)Generics:Provides compile-time (static) type safety 

Java Interview Questions

java - Java Interview Questions
Helpful Java Interview questions   Need Helpful Java Interview questions 

Java Interview Questions

java questions - Java Interview Questions
java questions  HI ALL , how are all of u?? Plz send me the paths of java core questions and answers pdfs or interview questions pdfs or ebooks :) please favor me best books of interviews questions for craking 

Java Beginners

JAVA QUESTIONS - Java Beginners
java questions asked in interview oracle  Hi all, Does anyone have a list of Java questions that is generally asked in Interview at Oracle 

General

Ask Questions with Options
Ask Questions with Options using Java In this section, we are going to ask five questions one after the other with four options to test the user. For this, we have stored 5 questions, answers with four options into a list. The list 

Java Interview Questions

interview questions - Java Interview Questions
interview questions for Java  Hi Any one can u please post the interview point of questions.Warm Regards, Satish 

Java Interview Questions

interview - Java Interview Questions
interview  kindly guide me some interview questions of Java 

Java Interview Questions

jdk 1.5 features - Java Interview Questions
jdk 1.5 features  jdk 1.5 features with examples and source code ,how to use the features  Hi friend, (1)Generics:Provides compile-time (static) type safety for collections and eliminates the need for most 

Java Beginners

java certification questions - Java Beginners
java certification questions  i need java certification questions 

Java Beginners

java questions
java questions  why java is not open source 

Java Beginners

java questions
java questions  why java is not open source 

Java Interview Questions

java - Java Interview Questions
Java Development  I need a Job in Java Development..so preparing for it. Can anyone please guide me how to prepare and what are the common questions that can be asked at interview 

Java Beginners

Java Interview Questions
Java Interview Questions  Hi, Can anyone tell the urls of Java Interview Questions on roseindia.net? Thanks 

General

Java arraylist generics example and arraylist generic list
Generics is used to make  the data type safe program. It is the new feature of java 5. When the ArrayList is generalized for a specific data... data type element. Example of Java Generic Arraylist import 

General

Java Generic Iterator
Java Generic Iterator is the new feature added to the jdk1.5. It is used to generalize the Collection classes. It makes the Collection class type safe. It is used with classes, methods and interfaces. Java Generics Iterator 

Java Beginners

Questions about Java's String pool
Questions about Java's String pool  Questions about Java's String pool 

Java Interview Questions

help me - Java Interview Questions
interview questions java pdf   Do you have any PDF for Java Interview questions 

Java Interview Questions

Struts - Java Interview Questions
Struts Interview Questions  I need Java Struts Interview Questions and examples 

Java Interview Questions

jvm - Java Interview Questions
jvm  Can you provide some JVM Questions for Java Interview preparation 

Java Interview Questions

java questions
java questions  can i write an inner class in an interface 

Struts Questions

Java Questions
Java Questions   How to dispaly my databsae records in my jsp page using collections My java class   Visit Here 

Struts Questions

Java Questions
Java Questions   How to dispaly my databsae records in my jsp page using collections My java class   Visit Here 

Java Beginners

java questions
java questions  what is the proper way of code our program?   Have a look at the following link: Core Java Tutorials 

Java Beginners

beginners questions
beginners questions  I need all the possible Java beginners questions to prepare for an Interview 

Java Interview Questions

java questions
java questions  what is the difference between wait() and sleep() methods in thread class 

Java Interview Questions

java questions
java questions  how is java platform independent? is jsp thread safe... (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language. When Java Code 

Java Interview Questions

Java - Java Interview Questions
://www.roseindia.net/java/example/java/util/HashTable.shtml Thank you for posting questions. Rose India Team 

Java Interview Questions

java Questions
java Questions  do we need to implement all methods interface if yes I want example code please send me 

Java Beginners

Java Questions
Java Questions  How can I set classpath for java classes through java.... There no general use of setting class path from the Java program. The servers... directory. Please let me know which jar files you want to set in Java class 

Java Interview Questions

JAVA - Java Interview Questions
JAVA  i need objective Questions and answers ( with 4 or 5 choice) in JAVA. Can anyone help me?   H1!! pl. mail your email id to asciimails@gmail.com. I will send you within 2-3 days. Krishna 

Java Interview Questions

java - Java Interview Questions
questins in java .wat normally v see in interviews (tech apptitude)is one line... simple 2 answer..but it becomes complicated wen v see questions in jumbled form... ...or any of the sites....which handles these kind of questions...   Hi 

Java Interview Questions

java - Java Interview Questions
java  i want to java&j2ee interview questions. Regards Akhilesh Kumar  Hi friend, I am sending you a link. This link will help you. Read for more information. http://www.roseindia.net/interviewquestions 

Programming Tutorials

Java Questions & Java FAQ
Java Questions & Java FAQ  ... have listed the Java Questions which are commonly asked. Our collection... questions about the Sun Programming Language.  Here are the list of those Java 

Servlet Interview Questions

java - Servlet Interview Questions
java  servlet interview questions  Hi friend, For Servlet interview Questions visit to : http://www.roseindia.net/interviewquestions/servlet/ Thanks 

Java Interview Questions

java - Java Interview Questions
Java interview questions and answers for freshers  Please provide me the link of Java interview questions and answers for freshers  Hi friend,class Point{ int x, y; Point(){ System.out.println("default" 

Core Java

Java generic
.style1 { color: #000080; } Java generic       Java 1.5 provides number of new features to the Java Language including "Java Generics". Using generics makes 

JSP Interview Questions

java interview - JSP-Interview Questions
java interview  what type of questions would be asked to a 3 years experience person in java? can anyone please provide list of topics or interview questions for 3 years experience in java 

Java Interview Questions

hint - Java Interview Questions
hint  Dear roseindia, i want the java interview question and the corresponding question answers.   Hi Friend, Please visit... of interview questions and their answers. Thanks  thanks for your 

Servlet Interview Questions

java - Servlet Interview Questions
Java Design Patterns Interview Questions and Answers  I need to know Java Design Patterns with the help of Interview Questions and Answers  Hi malli,GenericServlet is the super class of HttpServlet calssjava soft 

Java Interview Questions

java - Java Interview Questions
Java Programming  What is Java Programming language 

Java Beginners

Java Questions - Java Beginners
Java Questions  Can we make 3d games in java 

Java Interview Questions

java - Java Interview Questions
java  how to learn java 

Java Interview Questions

Java - Java Interview Questions
Java  definition for "USER DEFINE PACKAGE FOR JAVA 

Java Interview Questions

java - Java Interview Questions
Java a complete reference  Need a Complete reference on Java.  www.geekinterview.com/question_details/17043 

Java Interview Questions

java - Java Interview Questions
java  Is JAVA 100% OOPL??  Hi friend, Yes,Java is 100% OOPL. Thanks 

Java Interview Questions

java - Java Interview Questions
Java io package hierarchy   What is the hierarchy for Java io Package 

Advertisements Advertisements
 

 

 

DMCA.com