A ______ modifier method means the method can be accessed without creating the object of the class.
Which of these interfaces extends the DataInput interface?
To do narrowing conversion we use cast. Cast is nothing but ______ type conversion.
Which of these method returns a smallest whole number greater than or equal to variable A?
class test{
public static void main (String[] args) {
int sum = 0;
for (int i = 2, j = -2; (~i^j)>0; ++i, j = i + 1)
sum += i;
System.out.println(sum);
}
}
Predict the output.
public class Abekusmain {
public static void main(String args[]) {
String a = null;
imstr(a);
System.out.println(a);
}
static void imstr(String a)
{
a = "Abekus.";
}
}
What is the output of the following code?
class A {
private A() {
}
void msg() {
System.out.println("Hello World!!");
}
}
class B {
public static void main(String[] args) {
A obj = new A();
obj.msg();
}
}
What is the output of the following Java code?
//Predict the output
import java.util.Scanner;
public class MyClass
{
public static void main(String args[])
{
StringBuffer str = new StringBuffer("contribute");
System.out.println(" " + str.toString());
}
}
interface A
{
public void a1();
}
class B implements A{
public void a1(){
System.out.println("please give feedback");
}
}
class C extends B{
public void a1(){
System.out.println("success is sure");
}
}
class testcase extends C{
public static void main(String args[]){
A obj = new C();
obj.a1();
}
}
What is the purpose of synchronization in the context of threads?