Which Java class is used to create a directory?
What is the purpose of the 'this' keyword in Java?
class test {
public static void main (String[] args) {
boolean a=true;
boolean b=!a;
boolean c=!b|a;
boolean d=a||!b;
System.out.println(c+" "+d);
}
}
Which of these is the correct way of defining a generic class?
class test{
public static void main (String[] args) {
final int a=10,b=20;
for(int i=0;a==b;i++)
{
System.out.println("Hello");
}
System.out.println("World");
}
}
public class outputs
{
public static void main(String args[])
{
String str1= new String("Abe");
String str2= new String("kus");
System.out.println(str1.concat(str2));
}
}
Predict the output of the following Java code:
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
String str = "Food court";
String str1 = "Food";
System.out.println(str.compareTo(str1));
System.out.println(str1.compareTo(str));
}
}
Predict the output of the following Java code:
class Abekua {
static String s = "";
public
static void main(String[] args)
{
P:
for (int i = 1; i < 8; i++) {
if (i == 4)
continue;
if (i == 5)
break P;
s = s + i;
}
System.out.println(s);
}
}
Predict the output of the following Java code:
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
String s1="abekus";
String s2="Abekus";
String s3="school";
System.out.println(s1.equalsIgnoreCase(s2));
System.out.println(s1.equalsIgnoreCase(s3));
}
}
Which of the following statements is incorrect about the use of generic and parameterized types in Java?