OOPs concepts 1

OOPs concepts
Object-oriented programming (OOP) is a programming paradigm that represents concepts as “objects” that have data fields (attributes that describe the object) and associated procedures known as methods.   What is an Object? An object can be considered a “thing” that can perform a set of related activities. The set of activities that the object performs ...

Null Keys or values in HashMap/Hashtable 4

Can java.util.HashMap store null key/value pair? Yes it can, However only one null key is allowed, but can store many null values against non-null keys   Example public class HashMapTest { public static void main(String args[]) { HashMap h = new HashMap(); h.put(null,null); h.put(null, "1"); h.put("1", null); h.put("1", "1"); h.put("2", null); System.out.println(h.get(null).toString()); System.out.println(h.get("1")); System.out.println(h.get("2")); } ...

NoClassDefFoundError and ClassNotFoundException

NoClassDefFoundError and ClassNotFoundException
NoClassDefFoundError is an Error ,occurs when the source  was successfully compiled but at runtime, the required class files were not found. It may also arise when the class is already loaded in different classloader(usually a parent classloader would have loaded the class and hence the class cannot be loaded again) or if an incompatible class definition ...

Microsoft Windows Briefcase

Microsoft Windows Briefcase
In Microsoft Windows, the Briefcase was a special folder that supports simple two-way file  synchronization between itself and another folder. The Briefcase is designed for mobile PC users so that they may transfer it to a removable drive and have it synchronize with the computer to which the removable drive is attached.The briefcase behaves just ...

Marker Interfaces

Marker interfaces are those which do not declare any required methods, but signify their compatibility with certain operations. The java.io.Serializable interface and Cloneable are typical marker interfaces. These do not contain any methods, but classes must implement this interface in order to be serialized and de-serialized.

Linux – Time Command

Linux - Time Command
Time command is used to determine the duration of execution of particular “command”. When the “command” completes , the time command writes the statistics ( the real elapsed time, the user CPU time and the sys CPU time) to the command line just after the output of the “command”.  

JVM, JRE, JDK 2

JVM (Java Virtual Machine) is an abstract machine.It is a specification that  provides runtime environment in which java bytecode can be executed. JVMs are available for many hardware and software platforms (i.e. JVM is plateform dependent).   The JVM performs four main tasks: Loads code Verifies code Executes code Provides runtime environment   JRE is an acronym for ...

JSP include standard action and include directive

S.No.  include directive  JSP include <jsp:include page="..." ></jsp:include>..........  1. Content of the file specified in the attribute “file” of the include directive will be pasted as it is at tranlation time , where include directive is used in the jsp  At runtime, the includED file will be executed and the response will be included in the includING ...

Jsp Implicit Objects and EL implicit Variables

Jsp Implicit Objects  EL Implicit Variables  1. JspWriter out 2. HttpServletRequest request 3. HttpServletResponse response 4. HttpSession session 5. ServletContext application 6. Servlet config 7. Throwable exception 8. PageContext pageContext 9. Object page 1. cookie 2. pageContext 3. header 4. headerValues 5. param 6. paramValues 7. initParam 8. applicationScope 9. requestScope 10. sessionScope 11. pageScope

Invalid Statements

1. Using the method isUserInRole(), overrides any declarative authorization related to method in which it is invoked – isUserInRole() method itself doesn’t do any authorization. 2. name - value attribute is mandatory for  3. Benefits of the JSP precompilation is , it avoids initialization on the first request. 4.             java.lang.Error             /error.html           - valid value ...