[JAVA-621] Added missing code
* https://www.baeldung.com/java-type-erasure introduction code * https://www.baeldung.com/java-interfaces Electronic interface and Computer class * https://www.baeldung.com/java-abstract-class BoardGame and Checkers classes * https://www.baeldung.com/java-hashcode different ways of implementing hashCode * https://www.baeldung.com/java-inheritance-composition ComputerBuilder and StandardComputerBuilder classes * https://www.baeldung.com/java-equals-hashcode-contracts Renamed method to match article * https://www.baeldung.com/java-static Renamed class to match article * https://www.baeldung.com/java-nested-classes Renamed class to match article
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.typeerasure;
|
||||
|
||||
public class Example {
|
||||
|
||||
public static <E> boolean containsElement(E [] elements, E element){
|
||||
for (E e : elements){
|
||||
if(e.equals(element)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user