How many types of Modifiers are in Java?
Predict the output of the following Java code.
Any expression involving byte, int, and literal numbers is promoted to which of the following?
class test {
public static void main (String[] args) {
int a=5,b=6;
System.out.println(!(a>b)||(a<b));
}
}
Which of these methods can be used to determine the type of focus change?
class test{
public static void main (String[] args) {
int i=50000;
short s=(short)i;
byte b=(byte)s;
System.out.println(b+" "+s);
}
}
What is the value returned by the compareTo()
function if the invoking string is greater than the string being compared?
What would be the condition in if statement to filter the program from an exception?
Examine the following code fragment:
int j = 1; while (j < 10) { System.out.println(j + " "); j = j + j%5; }
What is the output to the monitor?
class test
{
public static void main(String[] args)
{
char a='A';
char b=70;
a++;
b--;
a+=10;
System.out.println(a+" "+b);
}
}