| Back to Questions Page |
| |
| Question |
why applet doesn't have main? isn't possible a program with
out main? |
Rank |
Answer Posted By |
|
Question Submitted By :: Sofiyaparvin |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Applets are standalone programs which require a third party
tool for its execution that is either it is java enabled
web browser,or applet runner.so it doesnt have main().It is
possible to run a program without main.  |
| Manjusinga |
| |
| |
| Answer | in applet they have separate life cycle so it's don't need
main  |
| Rajagopal |
| |
| |
| Answer | Before we discuss about the applet, let us know that there
are 2 categories where we use java to program,,,,they are
1. java stand alone and 2. web based programs
Applets fall under partial web based program. There is no
main(), as it does not require the same...we use
AppletViewer instead of the main() where the applet file is
embeded in the html file.....
Applet is a java file and we embed the same in the HTML
file and then we run the HTML embeded java (applet file)
thru the JDK tool AppletViewer.  |
| Abcd |
| |
| |
|
|
| |
| Answer | yes  |
| Varsha |
| |
| |
| Answer | yes it is possible  |
| Satya |
| |
| |
| Question |
what's diff between struts 1.1 & 1.2 |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
| This Interview Question Asked @ Wipro , Wipro |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Hi,new concepts in struts1.1 are1)changes to the web.xml
file as well as Struts-config.xml2)performExcecute() is
replaced by execute() method3)plug-ins
added4)RequestProcessor class..etc  |
| Vasu |
| |
| |
| Answer | The three differences I see as most significant are:
* Deprecation of ActionError class. (Use ActionMessage
instead)
* Ability to use wildcard characters in action mappings
* Improvments in the validation framework, including the
"validwhen" rule  |
| Imtiyaz |
| |
| |
| Question |
What is more advisable to create a thread, by implementing
a Runnable interface or by extending Thread class? |
Rank |
Answer Posted By |
|
Question Submitted By :: Pigadu |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Creating a thread using implementing Runnable interface
are more advisable. Suppose we are creating a thread by
extending a thread class, we cannot extend any other class.
If we create a thread by implementing Runnable interface,
we can extend another class.  |
| Bindhu Solomon |
| |
| |
| Answer | Hi...To create a Thread ,implement the Runnable interface
it is more advisable than extending a Thread class.By
extending the Thread class u can't achieve the multiple
inheritance.So implementing the Runnable interface is good
programming practice.
public class ThreadTest extends Thread,Applet
//This is illegal
public class ThreadTest extends Applet implements Runnable
//This is legal.  |
| Devarathnam C,kotagudibanda(po |
| |
| |
| Answer | Suppose ..you want to work with thread and also with a
class from AWT package.
java rule is that : YOu cannot extend more one class in
your program.
So it is adviseable to implement the runnable interface and
extend any other class which you desire....  |
| Abcd |
| |
| |
| Answer | When u extend a Thread each of your thread has a unique
object associated with it,where as with Runnable interface
may threads share the same object instance.  |
| Harish |
| |
| |
| Answer | by implementing runnable interface  |
| Ravikiran |
| |
| |
| Question |
can we have virtual functions in java? |
Rank |
Answer Posted By |
|
Question Submitted By :: Pigadu |
| This Interview Question Asked @ Wipro |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | In java, all methods are virtual functions by default. So
we can override a method in any subclasses .  |
| Bindhu Solomon |
| |
| |
| Answer | virtual functions are abstract methods in java. by default
all the methods are abstract in interface.  |
| Meera |
| |
| |
| Answer | By default all the methods are virtual functions in java.
So there is no need of virtual functions.  |
| Magan |
| |
| |
| Answer | In java all method use dynamic method lookup and therefore
are be default virtual. so there is no way to explicity
call an overriden base class method, but overwriting can be
prevented by declare a method final.  |
| Rakesh Kumar Jha |
| |
| |
| Answer | In object-oriented programming, a virtual function or
virtual method is one whose behavior can be overridden
within an inheriting class by a function with the same
signature. irtual functions are abstract methods in java. by
default
all the methods are abstract in interface.  |
| Amar |
| |
| |
| Answer | all methods in java are virtual.  |
| Dhawal |
| |
| |
| Answer | what virtual bebeen abstract diffrance  |
| Krishna |
| |
| |
| Question |
Why we need to serialize the object |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
| This Interview Question Asked @ Geometric-Software , Cts |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Whenever an object is to be sent over the network, and
moreover if the state of an object is to be saved, objects
need to be serialized...  |
| Bindhu |
| |
| |
| Answer | when ever an object's state needs to be saved to retrieve it
after some time we need to serialize the object.
Serialization is the process of writing the state of an object
to the stream.
The state of an object will be available in instance variables.  |
| Balaji |
| |
| |
| Answer | because the function to be indentified the object to the
variable.. so it needs to be serialize it ..  |
| Saravana Shankar |
| |
| |
| Answer | Whenever the data is confedential like passwords, pin codes
etc in this case object should be serialized.  |
| Abhi |
| |
| |
| Answer | For an example,if you are suppose to send some data from
obe JVM to other JVM, in that case state of ojects are not
known and will not persist if you dont serialize the object
and sent over a network.
because you allocate seperate heap for seperate JVM.
So you have to tell JAVA that please treat my object, in a
different way because i have make them serialised...
Once the data(object) is serialised, you cant send it any
wr like, write in to DB,othere JVM,files etc. and later
point of time you can deserialise them and you can the same
state of the object.
Hope this help.
Sandeep j  |
| Sandeep Jaisawal |
| |
| |
| Answer | object should be user friendly,it should be understand by the
third party on his first sight, to find the object  |
| Ragunath |
| |
| |
| Answer | Serialization is the process of saving the state of an object by converting it to a stream of bytes.the main purpose of serialize the object is to save the state of an object in order to have the ability to recreate the same object when required.  |
| Ragunath |
| |
| |
| Answer | mr.sandeep ur answer is little bit clear but wat happens if
i dont serialize and send thro a network will there any
dataloss ?  |
| Ashwin |
| |
| |
| Answer | Serialization is a process of writing the state of an
object to the byte stream and also its used to store the
state of an Object (such as a file or memory buffer). Its
for security purpose to send an object on the network.  |
| Sivadasan |
| |
| |
| Question |
Which class should you use to obtain design information
about an object |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The Class class is used to obtain information about an
object's design.  |
| Bindhu |
| |
| |
| Answer | from reflection package java.lang.reflect  |
| Ravikiran |
| |
| |
| Question |
What is the difference between Stream Reader and Stream Writer? |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | there are only Reader or Writer in io stream in java, to
read and write the data in the form of bytes.  |
| Meera |
| |
| |
| Answer | No, Readers and writers are used to read and write the data
as a character wise.
where as Streams ares used to read and write the data as a
binary wise  |
| Prasanna |
| |
| |
| Answer | StreamReader is designed for character input in a
particular encoding, whereas the Stream class is designed
for byte input and output. Use StreamReader for reading
lines of information from a standard text file.
Similarly StreamWriter in for writing into the standard file  |
| Aravindhan |
| |
| |
| Answer | StreamReader is designed for character input in a particular
encoding, whereas the Stream class is designed for byte
input and output. Use StreamReader for reading lines of
information from a standard text file.
StreamWriter is designed for character output in a
particular Encoding, whereas classes derived from Stream are
designed for byte input and output.  |
| Sharat |
| |
| |
| Question |
What is the exact difference in between Unicast and
Multicast object ? |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | A unicast packet is the complete opposite: one machine is
talking to only one other machine. All TCP connections are
unicast, since they can only have one destination host for
each source host. UDP packets are almost always unicast too,
though they can be sent to the broadcast address so that
they reach every single machine in some cases.
A multicast packet is from one machine to one or more. The
difference between a multicast packet and a broadcast packet
is that hosts receiving multicast packets can be on
different LANs, and that each multicast data-stream is only
transmitted between networks once, not once per machine on
the remote network. Rather than each machine connecting to a
video server, the multicast data is streamed per-network,
and multiple machines just listen-in on the multicast data
once it's on the network.  |
| Meera |
| |
| |
| Question |
To what value is a variable of the Boolean type
automatically initialized? |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | false  |
| Bindhu |
| |
| |
| Answer | a variable of the Boolean type
automatically initialized to false  |
| Harikrishna |
| |
| |
| Answer | false  |
| Ravikiran |
| |
| |
| Question |
How does serialization work |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
| This Interview Question Asked @ Ordain-Solutions |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The class whose instances are to be serialized
should implement an interface Serializable. Then pass the
instances to the ObjectOutputStream which is connected to a
FileOutputStream. This will save the object to a file...
When an object ios serialized, all the included
objects are also serialized along with the original object.  |
| Bindhu |
| |
| |
| Answer | Serialization is a marker interface to tell the jvm that
the class extending Serializable interface wants to persist
or write its state over the output stream. All the
variables other than transient type can only be persisted.  |
| Sudhakar Rao |
| |
| |
| Question |
Which Math method is used to calculate the absolute value of
a number? |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The abs() method is used to calculate absolute values.  |
| Sitaram |
| |
| |
| Answer | Hi...
You can use Math.abs(); method .This is static method
defined in the Math class.  |
| Devarathnam C,kotagudibanda(po |
| |
| |
| Answer | abs()  |
| Ravikiran |
| |
| |
| Question |
When does the compiler supply a default constructor for a
class? |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
| This Interview Question Asked @ TCS |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | If we do not define any constructors, the
compiler inserts an invisible zero parameter
constructor "behind the scenes".  |
| Bindhu |
| |
| |
| Answer | when we do not specify constructor expectly,java complier
provides default constructor at the time of compliation time  |
| Satish |
| |
| |
| Answer | When we donot override the default constructor in a class,
which is extended implicitly by our class from java.lang
package, compiler supplies it.  |
| Sudhakar Rao |
| |
| |
| Answer | We cannot supply any constructor in the class the compiler
supply a default constructor.  |
| Ravichandra |
| |
| |
| Answer | In java if we do not create the constructor,by default it
will be automatically invoked at compile time  |
| Manju |
| |
| |
| Answer | Hi... The compiler will supply defaulst constructor when u
not supplied constructor in the program.  |
| Devarathnam C,kotagudibanda(po |
| |
| |
| Answer | when there is no other constructor with arguments is defined  |
| Ravikiran |
| |
| |
| Answer | java follows the constructor chaining and whenever a class
in instantiated,the cons of the super class is always
invoked and to follow that when a class without contructor
is loaded then the compiler at the compiler gives it a
default constructor in order to help that make instantiated
and invoke the super class cons, it autmatically makes a
consturc at compile time and writes the first line as
super(); which invokes the super class constructor.  |
| Puneet |
| |
| |
| Question |
what is Assertion? |
Rank |
Answer Posted By |
|
Question Submitted By :: Ravikumar |
| This Interview Question Asked @ Wipro |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | An assertion is a statement enables us to test our
assumptions about the program.
Each assertion contains a boolean expression that
our believe will be true when the assertion executes. If it
is not true, the system will throw an error.  |
| Bindhu |
| |
| |
| Answer | assertion is a condition which on being true will execute the statement.
else(if condition is false) it will throw an assertion error.)
if we want to enable the assertion, we need to enable the assertion by the option -ea.  |
| Myluvdeepu |
| |
| |
| Question |
what is java |
Rank |
Answer Posted By |
|
Question Submitted By :: Ramanareddy333 |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | java is plotform independent.java is robust.java is
sequre.java is like as c++.  |
| Dara Sitaramayya |
| |
| |
| Answer | Java is a high-level, object-oriented programming language
developed by Sun Microsystems. It is similar to C++, but
has been simplified to eliminate language features that
cause common programming errors. Java is a general purpose
programming language with a number of features that make
the language well suited for use on the Web.  |
| Sarika |
| |
| |
| Answer | java is object oriented programing language.java is plat
form independent.java is mainly used for web
applications.java does not use pointers why because it
provides security for any platform.  |
| Ranjitha |
| |
| |
| Answer | java is an object-oriented programming language devloped by
Sun Microsystem,Modeled on C++,java was designed to be
small,simple,and portable across platforms.  |
| Amit Raj |
| |
| |
| Answer | Hi...
JAVA is an object-oriented programming language.It support
sophisticated OOP'S concepts
like "Encapsulation", "Polymorphism" and "Inheritance".By
using java we can develop web-based applications,client-
server applications and distributed applications. Java is a
most suitable programming language for internet
technologies.The Sun's trade mark slogan is "WRITE ONECE
RUN ANYWARE", till now no programming is not achieving this
slogan, it is a platform independent and both compielet and
interpreted langauage.  |
| Devarathnam C,kotagudibanda(po |
| |
| |
| Answer | java is an object oriented programming language  |
| Ravikiran |
| |
| |
| Answer | Java is an Object oriented programming language developed
by sun microsystems.java is platform independent and mostly
suitable fot internet applications.java is simple b/c its
syntaxes are derived from c and oop's concepts are derived
from c++.It is more secure b/c it does not support
pointers.It is usefull to develop clientside and
distributed applications.  |
| Somasani |
| |
| |
| Answer | JAVA is one of the OBJECT ORIENTED LANGUAGE Developed By
Sun microsystems...Mostly java is used Bcoz JAVA treats
everything as OBJECT's in problem space AND identifies as
its Business data and methods....java gives three key OOP's
concepts ...like Encapsulation,polymorhism & Inheritance  |
| Ershad Md Sk |
| |
| |
| Answer | java is one type of language through which you can achieve anything , i mean to say here recent version of java supports certain feature through which you can do anything why because you can implement c features in java ,so , c is known as robust language and nothing can not be done by this c except data security which is supported by java.
java is object oriented language but not oops concept,
because it supports oops concept but not fully because still it uses primitive type.And remember that oops concepts are only encapsulation , polymorphism, inheritance. And java is also an ocean . java is an abstract language. java is simple language i mean to say here which increases overhead that is not supported by java.  |
| Priyabrata Patro |
| |
| |
| Question |
explain the classification of exception and hoew to handle
the exceptions |
Rank |
Answer Posted By |
|
Question Submitted By :: Ramanareddy333 |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | there are two types of exceptions in java
1> checked exceptions
checked exceptions are also known as compile time
exceptions as they are identified during compile time of
the program. It is also known as Normal Exception.
Example: FileNotFoundException,ClassNotFoundException, etc..
2> Unchecked exceptions
Unchecked Exceptions are also known as runtime exceptions
as they are identified during the runtime of the program.
Example: ArithmeticException etc..  |
| Bindhu |
| |
| |
| Answer | Checked and unchecked exceptions
We can handle the exception by make use of
try/catch/finally (or) by using throws clause  |
| Ravikiran |
| |
| |
|
| |
|
Back to Questions Page |