Tuesday, 23 September 2014

Immutable Class Interview Questions

Q1) What is an immutable class? Ans) Immutable class is a class which once created, it’s contents can not be changed. Immutable objects are the objects whose state can not be changed once constructed. e.g. String class Q2) How to create an immutable class? Ans) To create an immutable class following steps should be followed: Create a final class. Set the values of properties using...

Write a JAVA program to implement a Queue using user defined Exception Handling (also make use of throw, throws)

import java.io.*; class myException extends Exception { myException()   { System.out.println("Error:Password too short");   }   myException(int n)   { System.out.println("Error:Only adults can join");   } } class user_exception { public static void main(String s[])throws IOException,myException  ...

Friday, 12 September 2014

Diffs

what is difference between servlet and cgi? CGI : Written in C, C++, Visual Basic and Perl Difficult to maintain, non-scalable, non-manageable Prone to security problems of programming language Resource intensive and inefficient Platform and application-specific Every time a new process begins each time a request is made to CGI program. A CGI program (and probably also an extensive runtime system...