Can a single machine run multiple JVM instances?
Predict the output of the following Java code.
What is the output of the following Java code?
When no catch block is used, which of these handles the exception?
Which Java interface handles the event when a component is added to a container?
what should be the output of this code block?
public class abekus {
public static void main(String[] args) {
String input = "";
System.out.println("-" + input.trim().trim() + "-");
}
}
public class test
{
public static void main(String[] args)
{
int[] x=new int[5];
x[1]='a';
System.out.println(x[1]+" "+x[2]);
}
}
what should be the output of this code block?
import java.util.*;
class GenericStack < E > {
Stack < E > stack = new Stack < E > ();
public void push(E obj) {
stack.push(obj);
}
public E pop() {
E obj = stack.pop();
return obj;
}
}
public class Test {
public static void main(String args[]) {
GenericStack < String > gs = new GenericStack < String > ();
gs.push("Hello");
System.out.print(gs.pop() + " ");
GenericStack < Integer > gs = new GenericStack < Integer > ();
gs.push(44);
System.out.println(gs.pop());
}
}
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
public class LDT{
public static void main(String[] args){
LocalDateTime datetime1 LocalDateTime.of(2017,1,14,10,34);
LocalDateTime datetime2 datetime1.plusDays(120);
System.out.println("Before Formatting: datetime2);
DateTimeFormatter format DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
String formatDateTime datetime2.format(format);
System.out.println("After Formatting:" + formatDateTime);
}
}