Because they are used as part of a larger applications.
What is the difference between stringbuffer and stringbuilder class?
What is the modifier for the httpservlet class service method?
Protected.
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, ...
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?
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?
Servletexception,ioexception.
What is the difference between servlet and servlet container?
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...
What is the difference between assertion and exception?
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...
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?
Yes.A statement can have multiple labels:ex:label1: label2: system.Out.Println("mutliple labels. ");
Can we declare native modifier with abstract modifier?
No.
What is the another name for native methods?
Foreign methods.
If the array size is negative,what will happen?
If the array size is negative, a negativearraysizeexception is thrown
What are the legal modifiers to local inner classes?
Final or abstract but not both at the same time.
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?
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?
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?
Nonassosiative.
What is the output for the following snippet? System.Out.Println(-0.0 == 0.0);
True
Explain the contexts in which binary numeric promotion applies?
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?
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?
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?
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 are the valid modifiers for the local variables?
Final.
Is garbage collection concept platform dependent/indepentdent?
Platform dependent.
Is thread concept platform dependent or independent?
Platform dependent.
What are the characteristics of cookies?
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.
Class Java.Lang.Object
javax.servlet.servlet &nbs...
javax.servlet.servlet ->interface &...
What are the characteristics of servlets?
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...
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.
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?
Native is also non access modifier.
abstract, final, strictfp, static, transient and volatile
What is the difference between ceil() and floor().
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?
StringBuilder is a feature of Java 5
String builder has been implemented in 1.5 can any one expalin me in detail