What will be the output of the following Java program?
Predict the output of the following Java code.
What is the primary purpose of the PrintStream class in Java I/O?
public class Demo123{
public static void main(String args[]){
String s1= new String("Abekus");
int c= 5;
System.out.println(s1+=c);
}
}
What will happen if the recursive method does not have a base condition
what should be the output of this code block?
public class abekus
{
public static void main(String[] args) {
int arr[] = {
1,
2,
3,
4,
5
};
for (int i = 0; i < 5;) {
System.out.print(arr[i]);
}
}
}
Predict the output of the following Java code.
class Abekus {
static int i = 1;
public static void main(String[] args)
{
int i = 1;
for (Abekus.i = 1; Abekus.i < 10; Abekus.i++) {
i = i + 2;
System.out.print(i + " ");
}
}
}
Predict the output of the following Java code.
class AbekusParent
{ void fellow()
{
System.out.println("Abekus Parent class.");
}
}
public class AbekusChild extends AbekusParent
{ void fellow()
{
System.out.println("Abekus Child class.");
}
public static void main(String[] args)
{ AbekusParent o = new AbekusChild();
o.fellow();
}
}
What will be the code output?
//First Class definition.
package com.pk3;
public class Abekus{
protected void m1()
{
System.out.println("Protected method has been called.");
}
}
//Second class definition.
package com.pkg2;
import com.pk3.Abekus;
public class def extends Abekus {
public static void main(String args[]) {
Abekus A=new Abekus();
A.m1();
}
}
Note: Two classes are there.class def inherit the class Abekus.