java.util contain all the collection classes
Which is faster and uses less memory?
Which Java access modifier has a 'Different package non-subclass' modifier?
Predict the output of the following Java code.
Exposing only necessary information to clients ( main programs, classes) is known as
listIterator(int index) : This method returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
public class output{
public static void main(String args[]){
char num [] = new char[10];
for (int i = 0; i<=10; ++i){
num[i] = 'A';
System.out.print(num[i] + "");
}
}
}
Which of the following advantages of packages?
//Predict the output
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
String s1 = "Abekus";
String s2 = new String("Abekus");
s2 = s2.intern();
System.out.println(s1 == s2);
}
}
What will be the output of the following Java program?
import java.net.*;
class Networking
{
public static void main(String[] args) throws Exception
{
URL obj = new URL("https://www.abekus.com/javamcq");
URLConnection obj1 = obj.openConnection();
int len = obj1.getContentLength();
System.out.print(len);
}
}