String s1 = "My name is GFG";
// prints true
System.out.println(s1.contains("GFG"));
// prints false
System.out.println(s1.contains("geeks"));
public boolean contains(int value)
{
int index = indexOf(value);
if (index != -1)
{
return true;
}
return false;
}
private void checkResize()
{
int length = elementData.length;
if (size == length)
{
elementData = Arrays.copyOf(elementData, 2*size);
}
}