java.lang.security package is used for handling security-related issues in a program
Which of the following blocks executes compulsorily whether an exception is caught or not
public class Main {
public static void main(String[] args) {
String txt = "Hello World";
System.out.println(txt.toUpperCase());
}
}
You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?
class test{
public static void main (String[] args) {
int a,b,c,d;
a=b=c=d=40;
a+=b-=c*=d/=20;
System.out.println(a+" "+b+" "+c+" "+d);
}
}
Statement 1 - Integer takes 4 bytes of memory.
Statement 2 - Integer takes 32 bits of memory.
Statement 3 - Integer takes 6 bytes of memory.
public class output
{
public static void main(String args[])
{
double a = 4.5;
double b = 5.5;
double c = Math.min( a, b );
System.out.print(c);
}
}
What will be the output of the following program?
class A
{
public static void main(String args[])
{
int a = 10;
int b = 20;
int c;
c = ++b - b / a + a;
System.out.print(c);
}
}
Predict the output of the following Java code.
public class Abekus {
public static void main(String[] args) {
StringBuilder s1 = new StringBuilder("Amrit ");
String s2 = "Anand";
s1.append(s2);
s1.substring(8);
int i = s1.indexOf(s2);
System.out.println(i);
}
}