icon
Leave a message

Welcome to Java4u

A Single Place for all Java Resources

Looking for something?

Subscribe to this blog!

Receive the latest posts by email.

.Just enter your email below if you want to subscribe!

Email

OAuth 2.0

OAuth 2.0 is an open authorization framework and mainly focuses on authorization flows fand secures access to many well-known web APIs.

Monday, September 13, 2010

Introduction to Java Language

Java is an object-oriented programming language with a built-in application programming interface (API) that can handle graphics and user interfaces and that can be used to create applications or applets. Because of its rich set of API's, similar to Macintosh and Windows, and its platform independence, Java can also be thought of as a platform in itself. Java also has standard libraries for doing mathematics. Much of the syntax of Java is the same as C and C++. One major difference is that Java does not have pointers. However, the biggest difference...

HISTORY OF JAVA

James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects. The language, initially called Oak after an oak tree that stood outside Gosling's office, also went by the name Green and ended up later renamed as Java, from a list of random words. Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation.  Sun released the first public implementation as...

Tuesday, August 31, 2010

Struts FAQs

< Pre 1 2 3 4 Q24.What are the important tags of struts-config.xml ?  <struts-config>  <!-- ========== Form Bean Definitions ============ --> <form-beans> <form-bean name="login" type=" LoginForm" />  </form-beans>  <!-- ========== Global Forward Definitions ========= -->  <global-forwards>  </global-forwards>  <!-- ========== Action Mapping Definitions ======== -->  <action-mappings>    <action   ...

Struts FAQs

< Pre 1 2 3 4 Next >Q13. How you will handle exceptions in Struts?In Struts you can handle the exceptions in two ways:    a) Declarative Exception Handling: You can either define global exception handling tags in your struts-config.xml or define the exception handling tags within <action>..</action> tag. Example: <exception       key="database.error.duplicate"       path="/UserExists.jsp"      ...

Struts FAQs

< Pre 1 2 3 4 Next > Q12. What is RequestProcessor?   The controller is responsible for intercepting and translating user input into actions to be performed by the model. The controller is responsible for selecting the next view based on user input and the outcome of model operations. The Controller receives the request from the browser, invoke a business operation and coordinating the view to return to the client.The controller is implemented by a java servlet, this servlet is centralized...

Struts FAQs

1 2 3 4 Next >Q 1. What is MVC?  Model-View-Controller (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. Model: The model contains the core of the application's functionality. The model enca psulates the state of the application. Sometimes the only functionality it contains is state. It knows nothing about the view or controller. View: The view provides the presentation of the model. It is the look of the application. The view can access...

Collections FAQs

Q51. What is TreeMap?  TreeMap can be used to store a group of objects as key-value pairs where all the entries are arranged according to some sorting order of keys. The underlying data structure is RED-BLACK Tree Duplicates keys are not allowed but values can be duplicated. Insertion order is not preserved because insertion is based on some sorting order If we are depending on Natural sorting order then keys should be homogeneous(violation leads to ClassCastException)  but values need not homogeneous In case of customized...

Collections FAQs

Q41. What is difference between HashSet and TreeSet? HashSet TreeSet 1The underlying data structure is Hashtable 1The underlying data structure is balanced tree 2Heterogeneous objects are allowed 2       Heterogeneous objects are not allowed  bydefalut 3Insertion order is not preserved and it is based on hashcode of the objects 3   Insertion order is not preserved and all the objects are inserted according to some sorting order. ...

Collections FAQs

1 2 3 4 5 6 Next>Q31. Explain about HashSet class?The underlying data structure is Hashtable null values are accepted duplicates are not allowed insertion order is based on hashcode of the object hence insertion order is not preserved best  suitable if frequent operation is  search operations HashSet  class implements Serializable and Cloneable it is implementation class for Set interface heterogeneous objects are allowed it is introduced in 1.2 version Q32. If we are trying to insert duplicate values in Set what will...

Collections FAQs

Q21. What is difference between ArrayList and Vector?     ArrayList Vector 1. No method is synchronized in the ArrayList class 1. All methods in Vector are synchronized. 2. ArrayList object is not thread safe. 2.  Vector is thread safe. 3. Relatively performance is high 3. Relatively performance is low 4. Introduced in 1.2 version and it is non legacy 4. Introduced in 1.0 version and it is legacy Q22. How we can get synchronized version...