Method Overloading is determine at
When is method overloading determined?
Which of these method of class String is used to remove leading and trailing whitespaces.
Which of these classes can be used to implement an input stream that uses a character array as the source?
Will this program generate the same output if it is executed twice?
class Output
{
public static void main(String args[])
{
double z = Math.random();
System.out.print(z);
}
}
What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
String a = "hello i love java";
System.out.println(a.indexOf('e') + " " + a.indexOf('a') + " " + a.lastIndexOf('l') + " " + a.lastIndexOf('v'));
}
}
Which of the following is used to define an abstract class?
class Base {
final public void show() {
System.out.println("Base::show() called");
}
}
class Derived extends Base {
public void show() {
System.out.println("Derived::show() called");
}
}
class Main {
public static void main(String[] args) {
Base b = new Derived();;
b.show();
}
}
What will be the output of the program?
public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( "Finally" );
}
}
}
import java.util.*;
class output
{
public static void main(String args[])
{
Stack obj = new Stack();
obj.push("A");
obj.push("B");
obj.push("C");
obj.push("E");
System.out.println(obj.search("D") + " "+ obj.empty());
}
}