ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Java-Related >> Java-J2EE >> Core-Java
 
 


 

Back to Questions Page
 
Question
What is JIT ?
Rank Answer Posted By  
 Question Submitted By :: Vinayakkatkar
This Interview Question Asked @   Satyam , Satyam
I also faced this Question!!   © ALL Interview .com
Answer
Just In Time
 
1
Xxx
 
 
Answer
Since JRE version 1.2, Sun's JVM implementation has 
included a JIT (just in time) compiler. Unlike the previous 
interpreter that interpreted bytecode one instruction at a 
time, the JIT compiler converts the bytecode for a program 
into equivalent native machine code as the program is 
loaded into the virtual machine.
This results in faster execution
 
3
Umaira Fathima
 
 
Answer
JIT(just in time)compiler for the Java language allows 
interpreted Java programs to be automatically compiled into 
native machine language on the fly, for faster performance 
of the program. Some JVMs include a JIT compiler.
 
2
Tushar
 
 
 
Answer
Just in time(JIT) is a fast compiler.
Remember that when client system sends a request to server system,then the response is sent in two ways 
1)static response(google page) using html
2)Dynamic response(ex:cricket score update information)using Applets
To send user(client system)response in the form of  Webpage,applets program (in the form of bytecode) transferred from server to client system over the internet and executed using JIT(i.e converts bytecode to native code)
A webpage  may contain number of applet programs to give different reponses(updated news,cricket score....)then to execute each program using JVM is time taking process.so,JIT is used to compile all applet programs at once to reduce response time.
 
0
Rinky
 
 
Question
Is it possible to create Userdefined Unchecked Exception
also?If Yes, give an example?
Rank Answer Posted By  
 Question Submitted By :: Shiva034
I also faced this Question!!   © ALL Interview .com
Answer
We can't create Uncecked Exceptions
 
0
Balaji
 
 
Answer
You can create unchecked exception by inhereting
RuntimeException class. Spec does not say that we can't do
it but it is advisable to go for custom checked exception
 
0
Saf
 
 
Question
What is the need of "creating and throwing an
UserdefinedException" when the "Exception" class is already
available?
Rank Answer Posted By  
 Question Submitted By :: Shiva034
I also faced this Question!!   © ALL Interview .com
Answer
There are some exceptions that are not defined by java api
ex- invalid age exception ,invalid number exception etc.

in user defined exceptions are raised by programmer,
thrown by programmer ,handled by programmer

while predefined exceptions are raised by system,
thrown by system
handled by programmer
 
0
Vinayakkatkar
 
 
Answer
user defined exception is used throwing out(user) own
exception..
 
0
Guru
 
 
Answer
if you want you could specify your own exception that you
know is gonna happen otherwise it is recommended to handle
the exception through exception class in catch block.
 
0
Sri
 
 
Answer
UserDefindException are thrown and handled based on the 
user requirements to make sure the particular exception 
conditions intead of throwing the general exception for all 
the exceptions.

We should handle the specific exception first by using 
catching it instead of handling generic exceptions of type 
Exception.
 
0
Seshadri Pera
 
 
Question
What is the difference between throw and throws?
What is the similarity between try and throw?
Rank Answer Posted By  
 Question Submitted By :: Vinayakkatkar
I also faced this Question!!   © ALL Interview .com
Answer
throw is used to throw an exception manually, where as
throws is used in the case of checked exceptions
 
0
Giri
 
 
Answer
throw is a statement level.throws is a method level.
In manual exception handling,we can also use the throws to 
handle the excepions by the jvm,insted of handling there.
 
0
Amar
 
 
Question
when i write 
string s1="java";
in one program(application) and 
string s2="java";
in another application
on the same jvm will both objects s2,s2 will refer to same
memory location where "java" is stored
in string pool.
Rank Answer Posted By  
 Question Submitted By :: Vinayakkatkar
I also faced this Question!!   © ALL Interview .com
Answer
Yes,They will refer to same memory location..
 
0
Tj
 
 
Answer
String s1="java";
String s2="java";
System.out.println(s1.equals(s2)); -->true
System.out.println(s1==s2); --->true
 
0
Ss
 
 
Question
how exactly garbage collection take place?
Rank Answer Posted By  
 Question Submitted By :: Vinayakkatkar
I also faced this Question!!   © ALL Interview .com
Answer
Garbage Collection is an automated process in Java unlike C 
and C++. It executes to wipe out those objects which no 
longer are used in a program or stay idle for a very long 
time. This to free memory space alloted to these 
objects.However, it is not guaranteed that all the idle 
objects wil be destroyed every time garbage collection 
process gets executed.A user can also manually call the 
garbage collection to take place by executing System.gc() 
method.
 
0
Niraj Talukdar
 
 
Answer
Another way to call garbage collector :-
Runtime rt = Runtime.getRuntime();
rt.gc();
 
0
Vinay
 
 
Answer
Variable/object 
1. is eligible for garbage collection when no object refers
to it. 
2. Is eligible when its reference is set to null  i.e
objName=null.
3. referred by method variables or local variables are
eligible for garbage collection  when they go out of scope.
 
0
Vijayakumar Chinnasamy
 
 
Answer
As in Java its happen automatically, but if you want to do 
this force fully you can do this by the use of 
keyword "finalize".
 
0
Devil
 
 
Question
in a constructor what happen if u call super and this in 
the same class? i know  that it is not possible to call 
both in the same one? if we call what will happen?
Rank Answer Posted By  
 Question Submitted By :: Dsureshkumar28
This Interview Question Asked @   ITC-Infotech , Itc
I also faced this Question!!   © ALL Interview .com
Answer
The question clearly specifies "what happen if u _CALL_
super and this in the same class"

By call, probably, they mean:
   this();  /*Invoking the constructor*/
   super(); /*Invoking the parent class's constructor*/

I think the right answer is that it will raise a compiler
exception. Such a program will not compile.
 
0
Agile Being
 
 
Answer
it wil giv an exception -compiler exception
 
0
Srikant Bhat
 
 
Answer
It will run fine with no exception here is the example :

public class CheckException extends Thread{
	public CheckException(){
		super.start();
		this.start();
	}
@Override
public synchronized void start() {
	// TODO Auto-generated method stub
	super.start();
}
}
 
0
Ajay Dhingra
 
 
Answer
wont there be any stack overflow?
 
0
Srikant Bhat
 
 
Answer
We can't give both super() and this()in a constructor,
because both of these statements must be the first
statements in constructor. if you give super() as the first
statement then compiler error will come with this() call.
and vice versa.
but you can call the members with both super and this in a
constructor. here is the code.
class Base
{
	Base()
	{
		System.out.println("Base constructor");
	}
	void m1()
	{
		System.out.println("m1 of Base");
	}
}
class Derived extends Base
{
	Derived()
	{
		super();//it is ok.
		this();//raises compiler error 
      //but we can call the members with super and this 
            super().m1();//make sure that   super()in      
line must be marked comment
            this().m1();
	System.out.println("Derived constructor");
		}
	void m1()
	{
		System.out.println("m1 of Derived");
	}
	public static void main(String[] args) 
	{
	Derived d=new Derived();
	}
}
it works out
 
0
Madhu
 
 
Answer
No it doesn't work I have just tested
 
0
Srisanjana
 
 
Question
different types of threads?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
Thread is the path of execution of a program..Types of 
threads are Single-threaded and Multi-threaded...This is 
mainly differentiated on the basis of synchronisation..A 
synchronised thread means a single thread executed only 
once at a time..Multithread means threads are executed 
simultaneously...
 
0
Sivasubramanian.k
 
 
Answer
types of threads are daemon thread and non daemon thread.

that is one work in background like clock handler, and the 
one which we are used in the programs that is user defined 
threads.
 
5
Swapna
[Techmatics]
 
 
Answer
2 type are

1.kernel thread
2.user thread
 
5
Anoop Singh
[Techmatics]
 
 
Answer
singlethread
multithread
 
0
Sakthivel(gceb)(n.p)pollachi
[Techmatics]
 
 
Answer
we have three types of threads
1.User Define Thread(main Thread always execute first and 
start another thread)
2. Daemon thread (garbage Collection low priority thread)
3. GUI Thread( make as new create in main methods )
 
5
Ankush Sharma
[Techmatics]
 
 
Answer
single thread
 hyper threaed
 multi thread
 
0
Venkateswarlu
[Techmatics]
 
 
Answer
1.User Thread

and 2.Daemon Thread
 
0
Partha
[Techmatics]
 
 
Question
what is features of jdk 1.5?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   TCS , Accenture
I also faced this Question!!   © ALL Interview .com
Answer
(1)Generics:Provides compile-time (static) type safety for 
collections and eliminates the need for most typecasts 
(type conversion). (Specified by JSR 14.)
 
(2)Metadata: Also called annotations, allows language 
constructs such as classes and methods to be tagged with 
additional data, which can then be processed by metadata-
aware utilities. (Specified by JSR 175.) 

(3)Autoboxing/unboxing: Automatic conversions between 
primitive types (such as int) and primitive wrapper classes 
(such as Integer). (Specified by JSR 201.)
 
(4)Enumerations: The enum keyword creates a typesafe, 
ordered list of values (such as Day.MONDAY, Day.TUESDAY, 
etc.). Previously this could only be achieved by non-
typesafe constant integers or manually constructed classes 
(typesafe enum pattern). (Specified by JSR 201.) 

(5)Swing: New skinnable look and feel, called synth. 
Varargs: The last parameter of a method can now be declared 
using a type name followed by three dots (e.g. void drawtext
(String... lines)). In the calling code any number of 
parameters of that type can be used and they are then 
placed in an array to be passed to the method, or 
alternatively the calling code can pass an array of that 
type. 

(5)Enhanced 'for loop': The for loop syntax is extended 
with special syntax for iterating over each member of 
either an array or any Iterable..
 
5
Sivasubramanian.k
 
 
Answer
it provides the working facilities like 
applications,applets and core java based programs
 
0
Sakthivel(gceb)(n.p)pollachi
[Techmatics]
 
 
Question
what is java bean?where can we use it?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
JavaBeans are reusable software components for Java that 
can be manipulated visually in a builder tool.[1] 
Practically, they are classes written in the Java 
programming language conforming to a particular convention. 
They are used to encapsulate many objects into a single 
object (the bean), so that the bean can be passed around 
rather than the individual objects.
 
0
Sivasubramanian.k
 
 
Answer
Java bean is simply a java class which has getter and 
setter methods.
setter methods are used  to set the data.
getter methods are used to to get the data.

Java beans are used to encapsulate objects in a single java 
bean so that the bean can be used or passed in other 
classes. 

Like in our jsp we can use this bean by using <%jspusebean> 
tag.
 
0
Namita
[Techmatics]
 
 
Answer
javabean is encapsulate data in the form of 
object.according to java specification javabean support any 
number of properties and any number of events and 
additional mthods..
 
0
Rameshkrishna
[Techmatics]
 
 
Question
what is jndi?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
The Java Naming and Directory Interface (JNDI) is an API 
for directory service that allows clients to discover and 
lookup data and objects via a name. Like all Java APIs that 
interface with host systems, JNDI is independent of the 
underlying implementation. Additionally, it specifies a 
service provider interface (SPI) that allows directory 
service implementations to be plugged into the framework. 
The implementations may make use of a server, a flat file, 
or a database; the choice is up to the vendor.
 
0
Sivasubramanian.k
 
 
Question
what is ejb? what is the importance of ejb?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   Photon
I also faced this Question!!   © ALL Interview .com
Answer
Enterprise Java Beans (EJB) is a managed, server-side 
component architecture for modular construction of 
enterprise applications.

The EJB specification is one of the several Java APIs in 
the Java Platform, Enterprise Edition. EJB is a server-side 
component that encapsulates the business logic of an 
application.
Accordingly, the EJB specification details how an 
application server provides:

Persistence 
Transaction processing 
Concurrency control 
Events using Java Message Service 
Naming and directory services (JNDI) 
Security ( Java Cryptography Extension (JCE) and JAAS ) 
Deployment of software components in an application server 
Remote procedure calls using RMI-IIOP. 
Exposing business methods as Web Services.
 
0
Sivasubramanian.k
 
 
Question
what is the use of servlet engine?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   Photon
I also faced this Question!!   © ALL Interview .com
Answer
The Java Servlet API allows a software developer to add 
dynamic content to a Web server using the Java platform. 
The generated content is commonly HTML, but may be other 
data such as XML. Servlets are the Java counterpart to non-
Java dynamic Web content technologies such as PHP, CGI and 
ASP.NET. Servlets can maintain state across many server 
transactions by using HTTP cookies, session variables or 
URL rewriting.

The Servlet API, contained in the Java package hierarchy 
javax.servlet, defines the expected interactions of a Web 
container and a servlet. A Web container is essentially the 
component of a Web server that interacts with the servlets. 
The Web container is responsible for managing the lifecycle 
of servlets, mapping a URL to a particular servlet and 
ensuring that the URL requester has the correct access 
rights.

A Servlet is an object that receives a request and 
generates a response based on that request
 
3
Sivasubramanian.k
 
 
Answer
Servlets exist in and are managed by the servlet engine in
the Application Server. The servlet engine is an internal
object that handles all servlet meta functions. These
functions include instantiation, initialization,
destruction, access from other components, and configuration
management
 
0
Ajay Dhingra
[Techmatics]
 
 
Question
why ,we are using jsp and html.which one is better?
Rank Answer Posted By  
 Question Submitted By :: Gopalraop
This Interview Question Asked @   Photon
I also faced this Question!!   © ALL Interview .com
Answer
JavaServer Pages (JSP) is a Java technology that allows 
software developers to dynamically generate HTML, XML or 
other types of documents in response to a Web client 
request. The technology allows Java code and certain pre-
defined actions to be embedded into static content.

The JSP syntax adds additional XML-like tags, called JSP 
actions, to be used to invoke built-in functionality. 
Additionally, the technology allows for the creation of JSP 
tag libraries that act as extensions to the standard HTML 
or XML tags. Tag libraries provide a platform independent 
way of extending the capabilities of a Web server.

JSPs are compiled into Java Servlets by a JSP compiler. A 
JSP compiler may generate a servlet in Java code that is 
then compiled by the Java compiler, or it may generate byte 
code for the servlet directly. JSPs can also be interpreted 
on-the-fly reducing the time taken to reload changes.

So JSP is better than HTML as it contains both static and 
dynamic content..
 
4
Sivasubramanian.k
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com