Find jobs | Company-wise jobs
Jobseekers | Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Interview Q&A Tutorials .NET Java Soft skills CV GD Work from home IT practice test MBA practice test FAQs in PDF Books Jobs FAQs
Interview questions                                 
Java interview questions
Java frequently asked questions
Test your Java skills!
Test your JDBC skills!
Test your EJB skills!
 
Java objects, classes & methods
Java operator  Java variables
Java overloading and overriding
Java abstract classes
Java data types  Java arrays
Java exception  Java events
Java virtual machine
Java input and output
Java URL connections
Java sockets  JNDI
Java applets  Java AWT
Java drawing AWT components
Core java  JDBC  JSP  EJB
J2EE  JNI  Servlets  Struts
Java threading  J2ME  JMS
Java web services  RMI
Internationalization  JavaScript
EJB Architecture  Spring
Java Transaction API – JTA  JBOSS
Java transaction services, JTS
Java GUI Framework interview
SWT/JFace interview
MVC and Jface  JavaServer Faces
Hibernate interview  JAAS
JavaMail interview  Tomcat
MIDP interview
Weblogic interview
Ant interview
Websphere interview
Ruby interview
jQuery interview
Aspect Oriented Programming, AOP
Java design patterns
Java localization
More links
JavaServer Faces 
OpenCms Application Overview 
EJB 3 Entities 
Oracle Web RowSet 
 

Java interview questions

Java interview questions - part 1  

Next>>        Part1 | Part2 | Part3 | Part4 | Part5 | Part6
Explain how Java addresses the issue of portability and security.

Addressing Portability: Many computers of different types with several operating systems are connected to network / internet.............
Read answer

Why does Java have different data types for integers and floating-point values?

The integer and floating-point types are different in terms of the consumption of the bits which represent them. There are certain data types which are rightly apt for speed..............
Read answer

What is endianness? Describe the ways an integer is stored in memory.

Endianness is the process of ordering the addressable sub units such as words, bytes or bits in a longer word that is to store in an external memory...............
Read answer

Explain why Java uses Unicode

To enable a computer system for storing text and numbers which is understandable by humans, there should be a code that transforms characters into numbers...................
Read answer

What are the different loops available in java? How do we choose the right loop for a specific job?

A loop is a set of statements that is supposed to repeat one or more times. Java supports 3 loops................
Read answer

Explain why we don’t need to use new for variables of the primitive types, such as int or float

The key word ‘new’ is used for creation of objects. Primitive types are to use constants but not objects.............
Read answer

What is finalize()? Is finalize() similar to a destructor?

The finalize() method of java is invoked by JVM to reclaim the inaccessible memory location, When the ‘orphan’ object (without reference) is to be released, JVM invokes the finalize() method, when the next..................
Read answer

Go top

Why does String define the equals( ) method? Can’t I just use ==?

The equals() method is defined in String class in order to test whether two strings values are same sequence of characters. The method is for exclusively testing string objects, but not any other objects..................
Read answer

String objects are immutable in java. Explain how to create a string that can be changed.

A string object that is created using “String” class is immutable. The characters of the object can not be changed / modified. There are some methods, such as split(), substring(), beginsWith() etc...................
Read answer

Can we pass a primitive type by reference in java? How

Primitive types can be passed by reference. 1.By storing the primitive type value in an array of single element and passing it.................
Read answer

What do you mean by the term signature in java?

A signature in java is a combination of elements in a list such as constructor and methods thereby distinguishing them from other constructors and methods..................
Read answer

Static nested class vs. a non-static one.

A static nested class can not directly access non-static methods or fields of an instance of its enclosing class. They can be accessed by creating the object of the nested inner class. Where as non-static nested ....................
Read answer

Explain when we should make an instance variable private.

An instance variable can be declared as private to promote information hiding.............
Read answer

Overridden methods in Java

Overridden methods of super class in subclass allow a class to inherit and behave close enough. To avoid naming conflict and signature and type and number of parameters..............
Read answer

Go top

Is C++ access specifier called protected is similar to Java’s?

The java access specifier ‘protected’ is placed proceeding the member of the class and the access control is applicable only for that particular definition...............
Read answer

Why should we catch super class exceptions?

Every exception is represented by the instance of Throwable or its subclasses. An object can carry the information for the exception raising point to the exception handler which catches it...............
Read answer

Why would we manually throw an exception?

When an exception is to be handled which are not java class library, a user defined exception can be thrown. An exception can be thrown explicitly, when a condition is met. In other words, in a situation.............
Read answer

What is chained exceptions in java?

Once an application finds an exception, responds an exception by throwing another exception. It causes another exception. Knowing an exception that causes another exception is very useful.....................
Read answer

When should we create our own custom exception classes?

The term exception lets the programmer to know that there is something exceptional has occurred in the program. Apart from Java exception class library, a custom.................
Read answer

Go top

What are primitive type wrappers classes? Explain the purpose of primitive type wrapper classes.

Primitive type wrapper classes or simply wrapper classes are available in java.lang package for providing object methods for all the eight primitive types. All the wrapper class objects are immutable.................
Read answer

Why do you recommend that the main thread be the last to finish?

In an application, a program continues to run until all of the threads have ended. Hence, the main thread to finish at last is not a requirement. It is a good programming practice to make it to run last to finish................
Read answer

Why does Java have two ways to create child threads? Which way is better?

Java threads can be created graciously in two ways: implementing the Runnable interface and extending Thread class.............
Read answer

Tips on effectively using Multithreading to improve the efficiency of my programs.

In multiple processor systems, a large algorithm will split the process into threads. So that different processors can handle different threads...................
Read answer

Enumerations vs final variables in java.

Enumeration is type safe. Where as final variables are not. Enumeration supports to have a blend of various values............
Read answer

Is it possible for a method other than paint() or update() to output to an applet’s window? Explain how.

Yes I is possible for a method other than paint() or update() to output an applet’s window. It is mandatory to obtain a graphics context by invoking getGraphics() method............
Read answer

Go top

What is byte code and why is it important to Java’s use for Internet programming?

The compiled Java source code is known as byte code. Java compiler generates the byte code. The byte code can run on any platform / machine regardless of the system’s architecture..........
Read answer

Why does Java strictly specify the range and behavior of its primitive types?

Java strictly specifies the ranges for primitive values. The selection of values in integer or floating point types differs based on the requirement of an application..................
Read answer

What is Java’s character type, and how does it differ from the character type used by many other programming languages?

The char data type in Java is a single 16-bit Unicode character. It represents a character that could be any one of the world languages..................
Read answer

Explain the difference between the prefix and postfix forms of the increment operator.

The prefix operator ++ adds one to its operand / variable and returns the value before it is assigned to the variable. In other words, the increment takes place first and the assignment next.............
Read answer

What is the difference between the String methods indexOf( ) and lastIndexOf( )?

The method indexOf() returns the first occurrence (index) of a given character or a combination as parameter in a given string.................
Read answer

Explain the difference between protected and default access.

The default access specifier is one which is not specified with a key word. If no access specifier (any one of private, protected, public) is mentioned it is known as the default access specifier.............
Read answer

Go top

Explain the two ways that the members of a package can be used by other packages.

There are two ways of affecting access levels. One, when the classes in the Java platform are used within the developer defined classes, the access levels determine the members of those class which can be used by the developer defined classes................
Read answer

Explain Java’s delegation event model.

The event model is based on the Event Source and Event Listeners. Event Listener is an object that receives the messages / events. The Event Source is any object which creates the message / event...................
Read answer

Describe the assert keyword.

The programmer assumes certain code while developing when handling exceptions. For example, a number is passed as parameter to a method..............
Read answer

Explain why a native method might be useful to some types of programs.

Java Native methods are useful when an application can not be written completely in Java language. For instance, when a Java application needs to modify an existing application which was developed.................
Read answer

Explain the use of shift operator in Java. Can you give some examples?

Using shift operators in Java we can 1. Integer division and multiplication is done faster. Example 84547 * 4 can be done by using 84547 << 2 .............
Read answer

Why do we need wrappers like Integer, Boolean for int, boolean in Java?

Wrapper classes are used to represent primitive data types as objects. Dealing primitive types as objects is sometimes easier. Many utility methods are available in wrapper classes......................
Read answer

Array vs ArrayList vs LinkedList vs Vector in java

Array vs ArrayList: ArrayList is much better than Array, when the size need to be increased dynamically. Efficiency is possible with arrays. ArrayList permits null elements...............
Read answer

Define Autoboxing with an example.

The automatic conversion of primitive int type into a wrapper class object is called autoboxing. It does not require to type cast the int value..................
Read answer

Go top

Can Java communicate with ActiveX objects? Explain how.

Java can communicate with ActiveX objects by using Bridge2Java from IBM. Bridge2Java is a tool for allowing the java applications for communicating with ActiveX objects.............
Read answer

What is CLASSPATH variable? What is default classpath?

CLASSPATH is an environment variable that communicates JVM and other java applications for finding the java language class libraries, including the developer’s class library............
Read answer

Explain how to convert any Java Object into byte array.

1. Create an object of ByteArrayOutputStream class. ByteArrayOutputStream bStream = new ByteArrayOutputStream();.................
Read answer

Explain how to convert bytes[] into File object.

1. Create a File object. File file = new File(“path and file name here”);..............
Read answer

JavaSpaces technology vs. database

Java spaces is a technology with powerful high-level tool for the development of distributed and collaborative applications. A simple API is provided based on the network shared space for developing................
Read answer

Explain the methods for accessing system properties about the Java virtual machine.

The system properties are accessed by the method System.getProperties(). This method returns a Properties object. By using the list() method of Properties, all the system properties can be viewed...............
Read answer

What is difference between add() and addElement() in Vector?

The add() methods inserts an element at a given position of the vector...............
Read answer

What is difference between sets and lists?

Sets can have unique values. Lists can have duplicate values...............
Read answer

Go top

What is fail-fast iterator in Java? What is it used for?

The unsynchronized collections and their modifications, iterations are termed as ‘fail-fast’ iterators. An iterator that implements Iterable interface..............
Read answer

Explain how to store and retrieve serialized objects to and from a file in Java.

The object’s current state can be persisted and retrieved by using the concept known as ‘serialization’. This is done on an object to a stream..........
Read answer

What is relation between JAXP and Xerces?

Xerces is a group of libraries for parsing, serializing, validating and manipulating XML.............
Read answer

What type of garbage collection does a System.gc() do?

Among various types of garbage collections, the System.gc() performs an explicit collection of garbage calls. The other garbage collection types are:...............
Read answer

When do I need to use reflection feature in Java?

Reflection feature in java allows an executing java program for introspecting upon itself. It also allows for manipulating internal properties of the program..................
Read answer

Explain how to measure time in nanoseconds.

Time is measured in nanoseconds by using the method nanoTime() method. This method returns the current value of the most precise system timer available in nanoseconds.............
Read answer

Java Thread: run() vs start() method

The method start() invokes the run() method. If the run() method of two threads invoked separately, they will execute one after the other.............
Read answer

Go top

What is Java Isolates and why do we need it?

Java Isolates is an API. It provides a mechanism to manage Java application life cycles which are isolated from each other. They can potentially share the underlying implementation resources............
Read answer

What are the system properties that applets are allowed to read by default?

The following are the system properties that Java applets read by default with System.getProperty() method:..............
Read answer

What is jvmstat?

The jvmstat is a technology for adding light weight performance, configuration instrumentation to the HotSpot JVM. The jvmstat provides............
Read answer

Describe how to implement singleton design pattern in struts.

A singleton implementation is done using action class in struts framework. It performs as a front controller and every request will go through it............
Read answer

Difference between length and length()? Explain with an example for each.

The ‘length’ is an instance constant which is the size of an array. While the ‘length()’ is a method that returns the no. of the characters in a string..................
Read answer

Difference between >> and >>>? Explain with an example for each.

The >> is right shift operator. It shifts bits towards right. For example: 5 >> 1 returns 2. It shifts one bit towards right and one bit is lost.................
Read answer

What is an Anonynous inner class? Explain with an example

Anonymous Inner Classes - An inner class without a name. It allows the declaration of the class, creation of the object and execution of the methods in it at one shot...............
Read answer

Test your Java knowledge with our multiple choice questions!

Go top 

Next>>        Part1 | Part2 | Part3 | Part4 | Part5

More java interview questions with answers

How do we allocate an array dynamically in java?
What is the purpose of the wait (), notify (), and notifyAll() methods?
Explain with example how to initialize an array of objects.
What is the difference between the Boolean & operator and the && operator?
Explain CacheRowset, JDBCRowset and WebRowset.
How and when can we cast from one class to another?
How to send to receive datagram packet?
What is the advantage of the event-delegation model over the earlier event inheritance model?
What is the difference between a field variable and a local variable?
When do we need to flush an output stream?
Explain the purpose of garbage collection that the JVM uses.
Explain how to read a line of input at a time.
How does Java handle integer overflows and underflows?
Explain the difference between Integer and int in java.
What is javap?
Explain the processes performed by java virtual machine, i.e. loading, linking, initialization.

Topic-wise Java interview questions

Java features Java program execution Java architecture
Java class Java constructors Java class member terminology
Java packages Java garbage collector Java super keyword
Java overloading & overriding Java string class Java inner classes
Java reflection class Java swing Java layout manager
Java exception handling Java multithreading Java file handling
Java utility classes Java socket programming JDBC
Java interview Test your Java skills! Test your JDBC skills!
Test your EJB skills!    


 
Want to be hunted by potential employers? Just submit your key skills!

Popular FAQs

.NET .Net Architecture ADO.NET Java Oracle C#.NET
VB.NET DOT.NET AJAX ASP.NET NET Framework OOPS in .NET
C++ Sql Server Data warehousing EJB MySQL Linux
PHP UML Networking Testing XML  
 
Copyright © 2008 - 2010 CareerRide.com. All rights reserved.