Which of these is the wildcard symbol?
Static methods must only access static data
To concatenate 2 or more strings we use _____ operator.
The isInfinite()
method returns the value of the invoking object as a double
.
Choose a correct option for the correct declaration of an abstract method.
class test{
public static void main (String[] args) {
int sum = 0;
for (int i = 0, j = -2; i < 5 & j <= 5; ++i, j = i + 1)
sum += i;
System.out.println(sum);
}
}
A) Heap memory provides run time memory for java objects.
B) Non-heap memory is used to store per-class structures and other meta data of methods & constructors.
what should be the output of this code block?
public class abekus
{
public void sum(int a, int b){
System.out.print(a+b);
}
public static void main(String[] args) {
sum(0,0);
sum(-1,-1);
}
}
What will be the output of the following code if no argument is passed?
class abc
{
public static void main(String args[])
{
if(args.length>0)
System.out.println(args.length);
}
}
Predict the output of the following Java program. Assume that int is stored using 32 bits.
class Abekusmain {
public static void main(String args[]) {
int i = -1;
System.out.println(i >>> 30);
System.out.println(i >>> 28);
System.out.println(i >>> 31);
}
}