Home | Customer Login | Partner Login | Employee Login | Facebook Twitter LinkedIn |1.866.395.3000

You are here: Home > FAQ's > Java FAQ's

JAVA Faq's

1.What are Java generics?
2.What is Dynamic Binding?
3.What is JIT Compiler?
4.What are Abstract classes?
5.What is String Tokenizer?
6.What is Garbage Collector?
7.What is Inner Class?
8.What is Anonymous Class?
9.What is heap in Java?
10.What is Thread?
11.What is Daemon Thread?
12.What is Synchronization?
13.What is Serialization?
14.How are memory leaks possible in Java?
15.Can a method be static and synchronized?
16.What is better to use: array or vector?
17.Whats the difference between the two: System.err. and System.out? When should we use System.err?

1.What are Java generics?

Ans:"Java Generics" is a technical term denoting a set of language features related to the definition and use of generic types and methods. Generic types or methods differ from regular types and methods in that they have type parameters.

2.What is Dynamic Binding?

Ans:Means the code associated with the given procedure call is not known until the time of call the call at run time. (it is associated with Inheritance & Polymorphism).

3.What is JIT Compiler?

Ans: JIT- is a compiler for Byte code, The JIT-Complier is part of the JVM, it complies byte code into executable code in real time, piece-by-piece on demand basis.

4.What are Abstract classes?

Ans:Abstract classes can be used to implement the inheritance relationship between the classes that belongs same hierarchy.

5.What is String Tokenizer?

Ans:provide parsing process in which it identifies the delimiters provided by the user, by default delimiters are spaces, tab, new line etc., and separates them from the tokens. Tokens are those which are separated by delimiters.

6.What is Garbage Collector?

Ans: When an object is no longer referred to by any variable, java automatically reclaims memory used by that object. This is known as garbage collection. System.gc() method may be used to call it explicitly and does not force the garbage collection but only suggests that the JVM may make an effort to do the Garbage Collection.

7.What is Inner Class?

Ans:classes defined in other classes, including those defined in methods are called inner classes. An inner class can have any accessibility including private.

8.What is Anonymous Class?

Ans:Anonymous class is a class defined inside a method without a name and is instantiated and declared in the same place and cannot have explicit constructors.

9.What is heap in Java?

Ans:JAVA is fully Object oriented language. It has two phases first one is Compilation phase and second one is interpretation phase. The Compilation phase convert the java file to class file (byte code is only readable format of JVM) than Interpretation phase interorate the class file line by line and give the proper result.

10.What is Thread?

Ans:can be defined as single sequential flow of control with in a program.

11.What is Daemon Thread?

Ans:Is a low priority thread which runs immediately on the back ground doing the Garbage Collection operation for the Java Run time System. SetDaemon( ) – is used to create DaemonThread.

12.What is Synchronization?

Ans:Two or more threads trying to access the same method at the same point of time leads to synchronization. If that method is declared as Synchronized , only one thread can access it at a time. Another thread can access that method only if the first thread’s task is completed.

13.What is Serialization?

Ans:The process of writing the state of Object to a byte stream to transfer over the network is known as Serialization.

14.How are memory leaks possible in Java?

Ans:If any object variable is still pointing to some object which is of no use, then JVM will not garbage collect that object and object will remain in memory creating memory leak.

15.Can a method be static and synchronized?

Ans:No a static method can't be synchronized.

16.What is better to use: array or vector?

Ans:Arrays are faster, vectors are more dynamic. This should be evident just looking at the amount of code you need to traverse one versus the other.
It might also be beneficial to write a linkedlist class and use that.
That way you have a dynamic container which has potential to be faster than a vector (though still not as fast as an array). The problem with arrays is that if you need more space than the current size, you have to hardcode their copying into a bigger array.

17.Whats the difference between the two: System.err. and System.out? When should we use System.err?

Ans:System.out leads the output to the standard output stream (normally mapped to your console screen), System.err leads the output to the standard error stream (by default the console, too). The standard output should be used for regular program output, the standard error for errormessages. If you start your console program regularly both message types will appear on your screen.


Back To Top

Careers | Site Map | Terms of Use | Privacy Statement | Trademarks | Contact Us © 2011 Miracle Software Systems, Inc. All rights reserved