Advise for Freshers
Forget the laborious coding for string manipulations in C/C++. It is made easier in Java with the introduction of String and StringBuffer classes.
I feel better if you follow the same order of reading, as is in the following links, to have easy go.
- A) String Programs
- Introduction – Immutable Nature – Comparison
- Finding matching characters
- Extracting Part of a String
- String Contains
- Concatenation – Conversion
- String – uppercase, lowercase, replacing
- Region Matches – Interning – Splitting
- Converting Data types into Strings
- Java String Array
- String replaceAll
- Java String Split – JDK 1.4 Introduction
- B) StringBuffer Programs
- StringBuffer – Length and Capacity
- Searching, Appending and Inserting
- Deleting, Replacing, Palindrome
- Petty Methods and Pass-By-Reference
- contentEquals Java
- C) Logical Programming – Increases coding skills.
- String to char array and byte Array
- Static Final String
- StringBuffer to String
- How many ways a string object can be created?
- Java String Capitalize
- Java Array to String
- Java String to Array
- Char Array to String
- toString Java
- Java String Tokenization
- Char array and Byte array to String
- Java String Reverse
- String Substring Contains
- String, StringBuffer, StringBuilder
============================================================
String and data type conversions
String TO | byte | short | int | long | float | double | char | boolean |
byte | short | int | long | float | double | char | boolean | TO String |
hello sir,
hope you doing well…
String str = “yyy”;
String str1 = “y” “y” “y”;
the output of both is “yyy”
But when I am comparing them ( str == str1 ) , result is showing they are not equal.
what’s the reason ?
Because they refer two different locations
Hi,
I have created a string object as follows:
String s=new (“java”);
As 2 objects are created with the above stmt. one is in string literal pool and another is in heap area and heap area string object is refer to s.
i.e s———> java (heap area object)
My requirement is i want change the reference vaiable s would point to string object which is in string literal pool. i.e
s —————> java ( string literal pool).
Please let me know How can i refer to the string object of string literal pool ?
Thanks & Regard
Bikash
How your can refer a string from pool without external handle?
Hi,
How can I concatenate 2 strings without using + & concate () in java ?
Regards
Bikash
Use append() of StringBuffer.