GeekInterview.com
Submitted Questions

Why the Java interpreter can't run directly the applet.Eventhought the Java applet is a compiled Java code?

Asked By: sujatham | Asked On: Sep 14th, 2007

Because they are used as part of a larger applications.

What is the difference between stringbuffer and stringbuilder class?

Asked By: sujatham | Asked On: Aug 9th, 2007

Answered by: santhakumarchimata on: Mar 15th, 2011

StringBuilder is a feature of Java 5


Methods in StringBuffer are Synchronized & thread safe.
Methods in StringBuilder are not Synchronized & not thread safe.

If you want faster access use StringBulder. If you want your string to be thread safe, use StringBuffer.

Answered by: sampra on: Mar 11th, 2008

String builder has been implemented in 1.5 can any one expalin me in detail

What is the modifier for the httpservlet class service method?

Asked By: sujatham | Asked On: Aug 8th, 2007

Protected.

Answered by: delindia fathima on: Dec 22nd, 2011

Sorry i was not clear with my previous answer.So posting answer again We have two service methods in httpServlet public void service(ServletRequest req, ServletResponse res) throws ServletException, ...

Answered by: delindia fathima on: Dec 20th, 2011

We have two service methods in httpServlet Dispatches client requests to the protected service method. Theres no need to override this method. public void service(ServletRequest req, ServletResponse...

What is the difference between servlet init( ) and servlet destroy( ) methods?

Asked By: sujatham | Asked On: Aug 8th, 2007

Answered by: g4java on: Aug 17th, 2007

init() is the beginning of the servlets life cycle and destroy is the end of it.

What are the checked exceptions servlet service methodcan throw?

Asked By: sujatham | Asked On: Aug 8th, 2007

Servletexception,ioexception.

What is the difference between servlet and servlet container?

Asked By: sujatham | Asked On: Aug 8th, 2007

Answered by: dhruv_saksena on: Mar 15th, 2008

A Servlet is that portion of your J2EE application which handles ur requets and where the buisness logic is implemented and depending on the request a response object is generated which is sent back t...

Answered by: sampra on: Mar 4th, 2008


Servlet is sever side of the Java pgm. That is executed by the servlet container.
this is ok  

What is the difference between assertion and exception?

Asked By: sujatham | Asked On: Aug 4th, 2007

Answered by: raghuprasad on: Aug 25th, 2008

There is no concept called Assertion present in Java. Exception is the program error which arises due to uncontrolable condition. This condition can be arised automatically from to program code(Eg. Da...

Answered by: raj_sharma on: Aug 21st, 2008

Exception is a mechanism used by many programming language to describe what to do when something unexpected happens.Assertion is the way to test the certain assumptions about the logic of your program.

Can a statement have a multiple labels?

Asked By: sujatham | Asked On: Jul 31st, 2007

Yes.A statement can have multiple labels:ex:label1: label2: system.Out.Println("mutliple labels. ");

Can a declaration statement have a label?

Asked By: sujatham | Asked On: Jul 31st, 2007

No.

Can we apply transient variable to methods?

Asked By: sujatham | Asked On: Jul 31st, 2007

No.

Can we declare native modifier with abstract modifier?

Asked By: sujatham | Asked On: Jul 31st, 2007

No.

What is the another name for native methods?

Asked By: sujatham | Asked On: Jul 31st, 2007

Foreign methods.

Can we give array size is 0?

Asked By: sujatham | Asked On: Jul 31st, 2007

Yes

Answered by: g4java on: Aug 17th, 2007

Yes we can but we can not put any value

If the array size is negative,what will happen?

Asked By: sujatham | Asked On: Jul 31st, 2007

If the array size is negative, a negativearraysizeexception is thrown

What is the final field array object have?

Asked By: sujatham | Asked On: Jul 31st, 2007

Length

What are the legal modifiers to local inner classes?

Asked By: sujatham | Asked On: Jul 31st, 2007

Final or abstract but not both at the same time.

Whether the Java uses call_by_value parameter passing strategy or call-by-reference parameter passing strategy?

Asked By: sujatham | Asked On: Jul 31st, 2007

The parameter passing strategy in Java is call-by-value and not call-by-reference, regardless of the type of the parameter.

What is the difference between actual parameters and formal parameters?

Asked By: sujatham | Asked On: Jul 31st, 2007

Actual parameters are parameters passed to the method when the method is invoked by a method call, and can vary from call to call. Formal parameters are parameters defined in the method definition.

How can we calculate the shift distance in shift operators?

Asked By: sujatham | Asked On: Jul 31st, 2007

The shift distance is calculated by and-ing the value of the right-hand operand with a mask value of 0x1f (31) if the lEFT-hand has the promoted type int, or using a mask value of 0x3f (63) if the lEFT-hand has the promoted type long. This effectively means masking the five lower bits of the right-hand...

Whether relational operators are assosiative or nonassosiative?

Asked By: sujatham | Asked On: Jul 31st, 2007

Nonassosiative.

Can we use strictfp modifier for variables?

Asked By: sujatham | Asked On: Jul 31st, 2007

Explain the contexts in which binary numeric promotion applies?

Asked By: sujatham | Asked On: Jul 31st, 2007

Binary numeric promotion is applied in the following contexts:1.Operands of the arithmetic operators *, /, %, +, and - 2.Operands of the relational operators = 3.Operands of the numerical equality operators == and != 4.Operands of the integer bitwise operators &, ^, and |

What is binary numeric promotion states?

Asked By: sujatham | Asked On: Jul 31st, 2007

Binary numeric promotion implicitly applies appropriate widening primitive conversions so that a pair of operands have the broadest numeric type of the two, which is always at least int. Given t to be the broadest numeric type of the two operands, the operands are promoted as follows under binary numeric...

Tell me the contexts in which the unary numeric promotion is applied?

Asked By: sujatham | Asked On: Jul 31st, 2007

Unary numeric promotion is applied in the following contexts:1.Operand of the unary arithmetic operators + and -2.Operand of the unary integer bitwise complement operator ~ 3.During array creation; for example, new int[20], where the dimension expression (in this case 20) must evaluate to an int value...

What is unary numeric promotion states?

Asked By: sujatham | Asked On: Jul 31st, 2007

Unary numeric promotion states thatif the single operand of the operator has a type narrower than int, it is converted to int by an implicit widening primitive conversion; otherwise, it is not converted

What is the default value for char?

Asked By: sujatham | Asked On: Jul 31st, 2007

'u0000'

What is the default value for boolean?

Asked By: sujatham | Asked On: Jul 31st, 2007

False.

What are the valid modifiers for the local variables?

Asked By: sujatham | Asked On: Jul 31st, 2007

Final.

Is garbage collection concept platform dependent/indepentdent?

Asked By: sujatham | Asked On: Jul 31st, 2007

Platform dependent.

Is thread concept platform dependent or independent?

Asked By: sujatham | Asked On: Jul 31st, 2007

Platform dependent.

What are the characteristics of cookies?

Asked By: sujatham | Asked On: Jul 31st, 2007

The following are a list of characteristics of cookies:1.Cookies are only sent back to the server that created them and not to any other server.For example,if a cookie was created by the web server of www.Macromedia.Com and sent to the client or the browser,the cookie can be sent back to the same server...

Describe servlet class hierarchy.

Asked By: sujatham | Asked On: Jul 31st, 2007

Class Java.Lang.Object

Answered by: fcasttro on: Nov 21st, 2007

                    javax.servlet.servlet          &nbs...

Answered by: rajesh on: Sep 26th, 2007

                  javax.servlet.servlet     ->interface      &...

What are the characteristics of servlets?

Asked By: sujatham | Asked On: Jul 31st, 2007

The characteristics of servlets that have gained them a wide spread acceptance are as follows:1.Servlets are efficient:the initialization code for a servlet is executed only when the servlet is executed for the first time.Subsequently, the requests that are received by the servlet are processed by its...

Answered by: Ashwinshenoy7 on: May 9th, 2011

To start with, servlets are small Java programs that run on the server side of a web program. Where as Applets are small Java programs that run on the client side.Characterisctics of servlets are...

Comparison between servlets and cgi scitpting technologies.

Asked By: sujatham | Asked On: Jul 31st, 2007

A cgi scripts is a program that is written in c,c++,or perl.A cgi script gets executed in a server.When a aserver receives a request from the client for processing data,the server passes the request to the cgi script.The cgi script processes the request and sends the output in the form of HTML to the...

What are the non access modifiers?

Asked By: sujatham | Asked On: Jul 31st, 2007

Answered by: divya_mini4u on: Sep 22nd, 2010

Native is also non access modifier.

Answered by: sampra on: Feb 15th, 2008

abstract, final, strictfp, static, transient  and volatile

What is the difference between ceil() and floor().

Asked By: sujatham | Asked On: Jul 30th, 2007

Answered by: sujatham on: Aug 3rd, 2007

static double ceil(double d) The method ceil() returns the smallest double value that is greater than or equal to the argument d, and is equal to a mathematical integer.static double floor(double d) T...

Which methods in object class are thread related methods?

Asked By: sujatham | Asked On: Jul 29th, 2007

Answered by: sampra on: Mar 6th, 2008

wait(),notify(),notifyAll()

Answered by: sampra on: Feb 22nd, 2008

wait(),notify(),notifyAll(

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: