-
-
Package Program
How to create a package program and what is the step to use a package program and how to run this type of programs?
-
instanceOf operator
what is difference between instanceOf operator and getclass()
-
-
How is it possible for two String objects with identical values not to be equalunder the == operator
The == operator compares two objects to determine if they are the same object inmemory. It is possible for two String objects to have the same value, but locatedindifferent areas of memory.
-
How do you create a Reader object from an InputStream object?
A) Use the static createReader( ) method of InputStream class.B) Use the static createReader( ) method of Reader class.C) Create an InputStreamReader object, passing the InputStream object as an argument to the InputStreamReader constructor.D) Create an OutputStreamReader object, passing the InputStream object as an argument to the OutputStreamReader constructor.
-
Java support RMI. What does this RMI stands for?
A) Random Memory InterfaceB) Remote Method InvocationC) Random Method InvocationD) Ramote Memory Interface
-
-
-
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.
-
-
-
-
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.
-
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 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,... -
-
-
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.
-
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
Java Interview Questions
Ans