Tags » Interview Questions

泛型Generics

泛型Generics

  

所谓泛型,就是变量类型的参数化。

泛型是JDK1.5中一个最重要的特征。通过引入泛型,我们将获得编译时类型的安全和运行时更小的抛出ClassCastException的可能。

在JDK1.5中,你可以声明一个集合将接收/返回的对象的类型。

使用泛型时如果不指明参数类型,即泛型类没有参数化,会提示警告,此时类型为Object。

为什么使用泛型

使用泛型的典型例子,是在集合中的泛型使用。

在使用泛型前,存入集合中的元素可以是任何类型的,当从集合中取出时,所有的元素都是Object类型,需要进行向下的强制类型转换,转换到特定的类型

比如:

List myIntList = new LinkedList(); // 1

myIntList.add(new Integer(0)); // 2

Integer x = (Integer) myIntList.iterator().next(); // 3…
317 more words

Study

leetcode: Word Ladder

Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from beginWord toendWord, such that:

  1. Only one letter can be changed at a time…
  2. 214 more words
Leetcode

Planning for the Worst Answer in Your Academic Interview

No matter how well prepared you are for your academic interview, you will almost certainly give one answer that you feel is less convincing than the others. 384 more words

International Students

SAP Solved-Questions & Answers-Local Data Base

Hi All,
Please download this document : C-TAW12-731-Sample-Questions

Download link : http://www.mediafire.com/download/4ld23jg8quiyj5e/
Keep Sharing Knowledge & Get Benefited..

Looking For Self Learning SAP Videos & Materials : Click Here

SAP ABAP

Things Affecting Interview Answers

Sometimes I’m asked by people for a specific answer they could give to a particular question that they anticipate having in an upcoming interview. While I can quite well give an answer to many of those questions, I know it is impossible to give all people an answer that is infallible in all interview situations. 852 more words

Job Search Advice

SAP Solved-Questions & Answers-Local Data Base

Hi All,
Please download this document : SAP Solved-Questions & Answers-Local Data Base

Download link : http://www.mediafire.com/download/w614f7005gluwww/
Keep Sharing Knowledge & Get Benefited..

Looking For Self Learning SAP Videos & Materials : Click Here

SAP ABAP