You are on page 1of 3

1/1/2011 Tech Interviews: JAVA Questions

Share Report Abuse Next Blog» Create Blog Sign In

BLOG ARCHIVE SUNDAY , DECEMBER 19, 2010 SEARCH THIS BLOG

2010 (4) Search


December
JAVA Questions pow er ed by
(4)
1. What is JAVA?
Difference
bitween C, CONTRIBUTORS
Cpp and Java is an Object-Oriented Programming Language. It has many
JAVA Ramakrishna Reddy
features.... Yasa
E-R Model
Ram
DBMS Hema Kumar Sunnapu
1. Simple: There are various features that makes the java as simple
JAVA
language. Programs are easy to write and debug because java
Questions
doesn't have pointers explicitly. Java provides the bug free system FOLLOWERS
due to the strong memory management. It also has the automatic
Upendra Reddy
memory allocation and deal location System. Options
2. Platform Independent: The concept of write once run
Followers (6)
anywhere is one of the important key feature of the java which
makes java as the most powerful language. The programs written
on one platform can run on any platform provided the platform
must have the JVM. Here JVM is platform dependent but java
program is independent. Your Friends (5)
3. Robust: Java has the strong memory allocation and automatic
garbage collection mechanism. It provides the powerful exception
handling and type checking mechanism as compare to other
programming languages. compiler check the compilation errors
Invite your friends
and run-time errors and makes the system secure from crash.
These features makes the java robust.
4. Object-Oriented Language: Unit of program is called object. It TOTAL PAGEVIEWS
is programming language model organized around objects rather
than actions and data rather than logic. In oops unit of program 274
is an object.
5. Distributed: The widely used protocols like HTTP and FTP are
developed in java. Internet programmers can call functions on
these protocols and can get access the files from any remote
machine on the net
6. Secure: Java doesn't use memory pointers explicitly. All the
programs in java are run under an area know as sand box.
Security manager determines the accessibility options of a class
like reading and writing a file to the lock disk. Java compiler
catches more compile-time errors, other languages will compile
programs that produce unpredictable results.
7. Multithreaded: Java is multithreaded programming language.
Multithread is a mechanism in which more than one thread run
independent of each process. When two are more threads are
executing in one process there is a chance to get space collision. In
order to avoid this problem we have concept called
synchronization.

It is a capability to control the access of multiple thread in a shared


resources.
Thread: A thread is a separate path of execution in a program.
A thread has four states

1. ready: Thread is ready to perform some task


2. running: Thread is performing some task
3. Waiting: Waiting for it's turn

…blogspot.com/…/java-questions.html 1/3
1/1/2011 Tech Interviews: JAVA Questions
4. Dead: no more executions

There are two types of threads:

1. Non-daemon Thread: it is also called as user-defined threads.


which will be created by users to perform some task.
2. Daemon Threads: Daemon threads compiler threads. Ex:
garbage collector. When the non-daemon thread come to
execution daemon thread will be dead.

There are two ways to create a Thread.

1. By extending Thread class


2. By implementing Runnable interface

Object-Oriented program follows the three characteristics.

Encapsulation: Encapsulation is a mechanism that binds together


code and data. It is a technique of making the fields in a class private
and providing access to the fields via public methods. This can be called
as data hiding.
It can be described as a protective barrier that prevents the code and
data being randomly accessed by other code defined outside the class.
The main benefit of encapsulation is the ability to modify our
implemented code without breaking the code of others who use our
code.
java offers four different access modifiers, public, protected, private and
default modifier

Inheritance: Inheritance is the process by which one object acquires


the properties of another object.There are two keywords we see in
inheritance are extends and implements. In inheritance we can find IS-
A relationship. Ex: Dog is a animal, boy is a human, girls is a human.
There are five types of inheritances:
Single inheritance: one sub class is extends to only one
super class. Ex: Class is B extends class A
Multiple inheritance: A class is extends one or more
classes is said to be multiple inheritance. Ex: class c extends
A,B
Java doesn't support the multiple insurance concept.
Through interface we can achieve this multiple inheritance
concept.
Multilevel inheritance: A class is extends B to class A and
B extends to class C is said to be multilevel inheritance
Hierarchical inheritance: One super class more than one
sub class is said to be hierarchical inheritance.
Hybrid inheritance: combination of multilevel and
multiple is said to be hybrid inheritance.
Real world Ex:

Polymorphism: Poly means many forms. It allows one interface to be


used for general class actions.
There are two types of polymorphisms.
Static polymorphism: It is also called as compile
polymorphism and static binding. This can be achieved
through the method overloading concept.
method overloading means same method name and different
parameters. This method overloading can be done compilation time.
Dynamic polymorphism: It is also called as run-time
polymorphism and dynamic binding. This can be achieved
through method overriding concept.When two methods are
declared with same name and parameters is said to be
method overriding.
…blogspot.com/…/java-questions.html 2/3
1/1/2011 Tech Interviews: JAVA Questions

Posted by Ramakrishna Reddy Y asa at 9:27 PM

1 comments:
laxmanyadavb said...
It is also called as compile-time polymorphism or static binding.
T his can be achieved through the method overloading concept.

method overloading supports early-binding


December 20, 2010 2:12 AM

Post a Comment

Com m ent as: Select profile...

Post Comment Preview

Newer Post Home

Subscribe to: Post Comments (Atom)

SUBSCRIBE TO TECH INTERVIEWS

Posts

Comments

Simple template. Template images by luoman. Powered by Blogger.

…blogspot.com/…/java-questions.html 3/3

You might also like