Comment on Tutorial - String Class Constructors in Java By Daniel Malcolm



Comment Added by : Jameesh

Comment Added at : 2015-03-05 07:09:38

Comment on Tutorial : String Class Constructors in Java By Daniel Malcolm
S.N. Constructor & Description
1 String()
This initializes a newly created String object so that it represents an empty character sequence.
2 String(byte[] bytes)
This constructs a new String by decoding the specified array of bytes using the platform's default charset.
3 String(byte[] bytes, Charset charset)
This constructs a new String by decoding the specified array of bytes using the specified charset.
4 String(byte[] bytes, int offset, int length)
This constructs a new String by decoding the specified subarray of bytes using the platform's default charset
5 String(byte[] bytes, int offset, int length, Charset charset)
This constructs a new String by decoding the specified subarray of bytes using the specified charset.
6 String(byte[] bytes, int offset, int length, String charsetName)
This constructs a new String by decoding the specified subarray of bytes using the specified charset.
7 String(byte[] bytes, String charsetName)
This constructs a new String by decoding the specified array of bytes using the specified charset.
8 String(char[] value)
This allocates a new String so that it represents the sequence of characters currently contained in the character array argument.
9 String(char[] value, int offset, int count)
This allocates a new String that contains characters from a subarray of the character array argument.
10 String(int[] codePoints, int offset, int count)
This allocates a new String that contains characters from a subarray of the Unicode code point array argument.
11 String(String original)
This initializes a newly created String object so that it represents the same sequence of characters as the argument; in other words, the newly created string is a copy of the argument string.
12 String(StringBuffer buffer)
This allocates a new string that contains the sequence of characters currently contained in the string buffer argument.
13 String(StringBuilder builder)
This allocates a new string that contains the sequence of characters currently contained in the string builder argument.


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. The code gives the following exception :-
<

View Tutorial          By: swetha at 2009-03-12 07:19:23

2. i like java language.
View Tutorial          By: deepika at 2014-09-22 15:11:39

3. Hi,

I tried this script with noki

View Tutorial          By: sravan at 2009-07-11 11:17:45

4. how to display images in j2me?? thank you :)
View Tutorial          By: bill at 2011-06-23 23:59:41

5. hi.I am new in j2me and really want to learn more
View Tutorial          By: vinoth kumar. A at 2012-10-26 05:20:31

6. I am new to this concept..It is really very useful
View Tutorial          By: karthiga at 2013-01-02 11:20:38

7. thnx
View Tutorial          By: Prakash at 2011-07-27 03:05:17

8. Hello MR, I was running sms package to send sms, a
View Tutorial          By: Ronized at 2008-12-29 16:53:33

9. thankyou Mr Ramlak for your help but please can yo
View Tutorial          By: yash at 2008-05-12 16:46:18

10. sir, i need java code to display position and velo
View Tutorial          By: Sandhya Yadav at 2015-08-20 07:16:04