public int start() returns start index of the previous match
Which of the following methods releases the lock when they are executed?
Which of the following is not a valid comment type in Java?
Wait(), notify(), notifyAll() must always be called in synchronized context otherwise IllegalMonitorStateException is thrown?
How to copy a file from one location to another?
What happens if a constructor is defined for an interface?
Which Java collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?
what should be the output of this code block ?
public class abekus {
public static void function (int[] arr) {
for (int i = 0; i < 5; i++)
arr[i] = arr[i] * 2;
}
public static void main(String[] args) {
int[] array = {
1,
2,
3,
4,
5
};
function (array);
for (int i = 0; i < 5; i++)
System.out.print(array[i]);
}
}
Predict the output of the following Java code:
import java.util.*;
public class Abekus {
public static void main(String[] args) {
LinkedList l = new LinkedList();
l.add(23);
l.add(34);
l.add(55);
l.add(88);
l.add(94);
System.out.println(l.peekFirst());
System.out.println(l);
}
}