This example shows how to reverse a string using the recursion technique. There are several ways to reverse a string one I have explained using the StringBuffer. Note: The best way is not to choose recursion technique for reversing the string. These concepts are usually used to teach students the recursion , not actual best practices …
Java String Reverse using StringBuffer Example
In this example we shall show you how to reverse the string object by using the Java StringBuffer class. StringBuffer class has a method reverse() which is convenient for reversing a given string value. As it is define in the specification: Causes this character sequence to be replaced by the reverse of the sequence. If …
Java String ReplaceAll Method Example
In this example we shall explain the replaceAll() method in the String class. With the replaceAll() method we can replace the whole or part of the string or character sequences. String objects are immutable and cannot be changed the value. When ever you change the value, new string object is created. This method also creates …
Java String Intern Method Example
String manipulation is one of the most read and confused subject for the Java programmers. String literals are stored in the string pool where identical objects are pointing to the same reference. If you look at the below example, we have created the “JavaBeat” string using the literals and “new” operator. When we create the …
JSF 2 Flash Scope Example
To minimize session scope bloat, it makes sense to use scope of request as much as possible. Without the redirect element, you can use request scoped beans that are shown in the next view. However, consider what happens with a redirect. The client sends a request to the server. The request scope map is populated …
Spring Tool Suite 3.5.0 Released
Last week Spring IO team has announce the next major release of their IDE Spring Tool Suite 3.5.0. If you are not familiar with their IDE, it is built on top of the Eclipse IDE to support the spring applications with easy to use features. It would support all the spring features out of the …
Spring Web Flow 2.4 RC1 Released
Last week Spring IO team has announced the first release candidate for Spring Web Flow 2.4. The release includes Java based configuration for Spring Web Flow and Spring Faces. Prior to this release, Spring Web Flow doesn’t support the Java based configurations. Here is the list of features included in this version. If you want to …
JSF 2 UI Debug Example
When you place the ui:debug tag in a Facelets page, a debug component is added to the component tree for that tag. If the user types a hotkey, which by default is CTRL+SHIFT+d, JSF opens a window and display the state of the component tree and the application’s scoped variables. You can click on the Component Tree …