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 we use the if sttmt l;ike this::
if (a

View Tutorial          By: Anubhav at 2010-11-14 08:15:04

2. hi .the program does run thank you for that ,i nee
View Tutorial          By: mazen at 2008-09-09 04:55:16

3. this site is excellent & too easy to understan
View Tutorial          By: Gaurav Kushwaha at 2010-08-16 06:30:45

4. Can anybody send me the java full code for sending
View Tutorial          By: David at 2010-08-22 22:57:38

5. static concept was clearly explained with some exa
View Tutorial          By: Rajkumar s ,m.p.patti,rasipuram. at 2012-03-28 16:17:31

6. How to read an array using BufferedReader?

View Tutorial          By: Dilnur Yuldashev at 2011-07-24 02:00:48

7. better..................
implements........

View Tutorial          By: sunny at 2012-01-04 17:30:12

8. fantastic
make something like this

View Tutorial          By: jyoti maheshwari at 2009-03-27 22:15:36

9. Explanation was good and easily comprehendable.
View Tutorial          By: Moin Adil at 2009-06-17 04:18:56

10. Good introduction to J2ME..thanks for sharing this
View Tutorial          By: Som at 2010-11-13 00:03:53