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. Can you send me the file please?
[email protected]

View Tutorial          By: laue at 2014-11-18 20:35:02

2. hi ashraf , ramlak and all,
i m new here .

View Tutorial          By: hemendra at 2009-12-28 21:59:34

3. How would you use a switch statement to determine
View Tutorial          By: Shivak at 2013-09-27 01:48:41

4. Good To understand.
View Tutorial          By: Radhika at 2010-05-11 01:24:55

5. You have to run the compiled PortScanner with two
View Tutorial          By: KRook at 2009-10-15 04:11:53

6. Thanks - very useful!
View Tutorial          By: Adam Musial-Bright at 2010-02-28 06:14:39

7. Thnaks a lot. Deep in brief.
View Tutorial          By: Thanks at 2012-05-23 03:36:37

8. @Palla Subramanyam : Your logic is correct, but SO
View Tutorial          By: Roopesh H at 2012-07-27 04:47:48

9. it is very useful and in understandable manner
View Tutorial          By: Deepika at 2012-03-26 05:10:15

10. Thanks for this tutorial . This provides me lots
View Tutorial          By: Pranit at 2011-07-25 09:12:29