JVM is platform independent or not?
Statement
try{
}catch{
}catch{
}catch{
}
Predict the output of the following Java code.
When an algorithm is written in a programming language, it becomes a _________?
How is garbage collection done in Java?
public class Demo123{
public static void main(String args[]){
int a=10;
Integer b=12;
if(b.equals(a)){
System.out.println("true");
}
else
System.out.println("false");
}
}
What is the output of the following Java code?
class Abekusmain {
public static void main(String[] args) {
StringBuffer a = new StringBuffer("Abekus");
StringBuffer b = new StringBuffer("AI-Driven");
a.delete(1,3);
a.append(b);
System.out.println(a);
}
}
Predict the output of the following Java code:
import java.util.*;
public class Abekus {
public static void main(String[] args) {
Deque<String> que = new ArrayDeque<String>();
que.add("h");
que.add("n");
que.add("j");
que.add("b");
que.poll();
System.out.println(que);
}
}
What will be the output of the program?
class PassS
{
public static void main(String [] args)
{
PassS p = new PassS();
p.start();
}
void start()
{
String s1 = "slip";
String s2 = fix(s1);
System.out.println(s1 + " " + s2);
}
String fix(String s1)
{
s1 = s1 + "stream";
System.out.print(s1 + " ");
return "stream";
}
}