Which of the following is not a bitwise operator
T parameters are used for a generic method to return and accept any type of object
toArray(T[]a) : This method returns an array containing all of the elements in this list in proper sequence (from first to last element)
public class abekus
{
public static void main(String[] args) {
int arr[] = {1,2,3,4,5};
int count = 0;
for(int i = 0 ; i<5; i++ ){
if(arr[i]%2==0)
count++;
}
System.out.print(count);
}
}
What will be the output of the following code ?
class A
{
public static void main(String args[])
{
int a = 4;
int b = 6;
int c = a | b;
int d = a & b;
System.out.println(c + " " + d);
}
}
Statement 1 -Array can be initialized using comma-separated expressions surrounded by curly braces
Statement 2 -Array can be initialized when they are declared
Which of the following statements about inheritance in Java is true?
public class outputs
{
static int cube(int x){
return x*x*x;
}
public static void main(String args[]){
int result=outputs.cube(5);
System.out.println(result);
}
}
What is the output of this program?
class Output
{
public static void main(String args[])
{
double x = 103;
double y = 5;
double z = Math.IEEEremainder(x, y);
System.out.print(z);}
}
}
Predict the output of the following Java code:
class Abekus {
public static void main(String[] args) {
int String = 23;
int Runnable = 67;
int Thread = 88;
int RuntimeException = 90;
System.out.println(String + " " + Thread);
System.out.println(RuntimeException + " " + Runnable);
}
}