What is the value of d
in the following Java code snippet?
double d = Math.round(2.5 + Math.random());
What will be the output of the following Java program? (Note: the file is made in the C drive.)
What is the term used to describe the handling of multiple tasks simultaneously?
How many times 'abekus' is printed?
public class abekus{
public static void main(String[] args){
for(int i = 0; i<5; i++)
{
System.out.println("abekus");
i++;
}
}
}
public class abekus
{
public static void main(String[] args) {
int a = 100;
String temp = Integer.toString(a);
System.out.println(temp);
}
}
class GFG {
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");
}
}
What is the output of the following Java code?
class Abekus {
public static void main(String[] args) {
int i = 0110;
switch (i) {
System.out.println("Welcome to Abekus!");
}
}
}
What is the correct output of following java program?
class Abekus {
final public void show() {
System.out.println("Abekus::show() called");
}
}
class Derived extends Abekus {
public void show() {
System.out.println("Derived::show() called");
}
}
public class Main {
public static void main(String[] args) {
Abekus b = new Derived();;
b.show();
}
}
Predict the output of the following Java code.
class Abekus
{
public static void main(String[] args)
{
int array1[] = {10, 20, 30, 40};
int array2[] = {10, 20, 30, 40};
if (array1 == array2)
System.out.println("Array1 and Array2 are same.");
else
System.out.println("Array1 and Array2 are not same.");
}
}
import java.util.*;
public class outputs
{
public static void main(String args[])
{
LinkedList list = new LinkedList();
list.add(new Integer(2));
list.add(new Integer(8));
list.add(new Integer(5));
list.add(new Integer(1));
list.addFirst(new Integer(6));
list.addLast(new Integer(9));
Iterator i = list.iterator();
Collections.reverse(list);
Collections.sort(list);
while(i.hasNext())
System.out.print(i.next() + " ");
}
}