-
-
Why do threads block on I/O
Threads block on i/o (that is enters the waiting state) so that other threads may executewhile the i/o Operation is performed.
-
-
What are the two ways to create the thread?
A) by implementing RunnableB) by extending ThreadC) Both a and bD) None of the above
-
Is the ternary operator written x : y ? z or x ? y : z ?
It is written x ? y : z.
-
-
When might your program wish to run the garbage collecter? (Select multiple)
A) before it enters a compute-intense section of codeB) before it enters a memory-intense section of codeC) before objects are finalizedD) when it knows there will be some idle time
-
Which one of the following is NOT a configurable JVM option?
Choice 1: Collect profiling and debugging statistics. Choice 2: Modify the number of bits a double variable uses. Choice 3 : Set the initial memory allocation pool size. Choice 4 :Modify the garbage collector's behavior. Choice 5 :Set the maximum memory allocation pool size.
-
-
-
What is output of the following Java program?
i want output of this program:
javaimport javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
public class Assimilator
{
public static void main(String[] args)
{
try
{
Properties props = new Properties();
props.put("mail.hosst", "mail.Pmc Tech.org");
Session mailConnection=Session.hetInstance(props,... -
Can a reference variable of Interface calls and equals method of Object call? If so, why?
javainterface X{
void m1();
void m2();
}
class Child2 extends Object implements X {
public void m1(){
System.out.println("Child2 M1");
}
public void m2(){
System.out.println("Child2 M2");
}
}
public class ParentChildInfterfaceDemo {
public static void main(String[] args){
X... -
What do you mean by static methods?
By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has static function f(), then we can call f() function as A.f(). There is no need of creating an object of class A.
-
-
-
-
If a method is declared as protected, where may the method be accessed
A protected method may only be accessed by classes or interfaces of the same package orby subclasses of the class in which it is declared.
-
-
-
Java support RMI. What does this RMI stands for?
A) Random Memory InterfaceB) Remote Method InvocationC) Random Method InvocationD) Ramote Memory Interface
Java Interview Questions
Ans