[8 Feb 2012 | One Comment | 8,257 views]

Environment Used

  • JDK 6 (Java SE 6)
  • EJB 3.0
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • JBoss Tools – Core 3.3.0 M5 for Eclipse Indigo (3.7.1)
  • JBoss Application Server (AS) 6.1.0 Final

Installing JDK

JDK should be installed with Read more…

[7 Feb 2012 | 11 Comments | 36,288 views]

Environment Used

  • JDK 6 (Java SE 6)
  • EJB 3.0
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • JBoss Tools – Core 3.3.0 M5 for Eclipse Indigo (3.7.1)
  • JBoss Application Server (AS) 5.1.0

Installing JDK

JDK should be installed with proper Read more…

[7 Feb 2012 | 127 Comments | 175,178 views]

Environment Used

  • JDK 6 (Java SE 6)
  • EJB 3.0 (stateless session bean)
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • JBoss Tools – Core 3.3.0 M5 for Eclipse Indigo (3.7.1)
  • JBoss Application Server (AS) 7.1.0.CR1b / Final

Setting up development Read more…

[6 Feb 2012 | One Comment | 8,940 views]

Environment Used

  • JDK 6 (Java SE 6)
  • EJB 3.0
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • JBoss Tools – Core 3.3.0 M5 for Eclipse Indigo (3.7.1)
  • JBoss Application Server (AS) 5.1.0

Installing JDK

JDK should be installed with proper Read more…

[20 Jan 2012 | No Comment | 694 views]

Converting primitive to String using valueOf()

The String class includes a set of static valueOf() methods that can be used to create strings from other Java objects and primitive types such as int, byte, char, double, boolean, etc.

MethodPurpose

Read more…

[20 Jan 2012 | No Comment | 1,110 views]
MethodPurpose
concat(String)Concatenates one string onto another.
length()Returns the length of the string.
replace(char old, char new)Replaces all occurrences of old character with new character.
toLowerCase()Converts the entire string to lowercase.
toUpperCase()Converts the entire string

Read more…

[20 Jan 2012 | One Comment | 807 views]

As we know, String objects are immutable; all String methods create a new String object in the memory to store the result and will not modify the original String object. Almost all methods from java.lang.String class are explained in the Read more…

[20 Jan 2012 | 3 Comments | 2,070 views]
  • Once a String object is created, its contents cannot be altered.
  • If you need to change a string, it always creates a new one that contains the modifications and makes the reference variable refer to the new object.

s1 = Read more…

[20 Jan 2012 | 29 Comments | 25,855 views]

There are slight differences between the various methods of creating a String object. String allocation, like all object allocation, proves costly in both time and memory. The JVM performs some trickery while instantiating string literals/objects to increase performance and decrease Read more…

[20 Jan 2012 | One Comment | 1,015 views]

All Java classes inherit a toString() defined in java.lang.Object that is used to generate a string representation of the object. For example, consider the following:

43

In this case, a Long object is created and set to hold the value Read more…