Recursion is managed by using
Up to how many numbers of classes can be present in a java program?
How can we simulate if-then behavior in JUnit tests?
public class abekus
{
public static void main(String[] args) {
float a = 10.0000f;
String temp = Float.toString(a);
System.out.println(temp);
}
}
class test {
public static void main (String[] args) {
int[][] arr=new int[][]{{0,1,2,3,4,5,6,7,8,9},{10,11,12,13,14,15,16}};
int n=(int)(2.5);
System.out.println((double)(arr[(int)--n][(int)n*5])/10*2+3/10);
}
}
//Predict the output
import java.util.Scanner;
public class MyClass
{
public static void main(String args[])
{
StringBuilder str = new StringBuilder("Welcomecoder");
StringBuilder str1 = str.replace(1, 7, "e are ");
System.out.println(" "+ str1);
}
}
//Predict the output
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
StringBuilder str = new StringBuilder("video game");
for (int i = 0; i < str.length(); i++)
{
char ch = str.charAt(i);
System.out.print(" " + i);
}
}
}
What will be the output of the following code?
abstract class A
{
int a;
abstract void display();
}
class B extends A
{
int b;
void display()
{
System.out.println(b);
}
}
class AbstractDemo
{
public static void main(String args[])
{
B obj = new B();
obj.a=1;
obj.b=2;
obj.display();
}
}
What will be the output of the following Java code?
class exception_handling
{
public static void main(String args[])
{
try
{
int a = args.length;
int b = 10 / a;
System.out.print(a);
}
catch (ArithmeticException e)
{
System.out.println("1");
}
}
}