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. class Evaluate
{
public static void

View Tutorial          By: prajjawal at 2013-02-27 12:36:58

2. pls help me how to solve the timeout problem

View Tutorial          By: nisha at 2010-09-20 22:29:17

3. i am run code this rectify this error please some
View Tutorial          By: indiran at 2010-01-28 01:45:56

4. place both comm.jar and javax.comm.properties in l
View Tutorial          By: Rania at 2010-09-14 19:52:49

5. can i also get the variable description for this p
View Tutorial          By: Maya Rao at 2013-10-04 06:06:00

6. I get this error:
Can someone please help m

View Tutorial          By: Carlos at 2010-06-14 02:42:53

7. i wrote ocjp exam on oct 27,2012. But still i didn
View Tutorial          By: Yashwinkkumar R at 2013-02-17 09:05:29

8. Cant undrstand clearly
View Tutorial          By: rathika at 2014-06-09 11:02:16

9. this is WRONG!

your IF should be:
View Tutorial          By: notnooblikeyou at 2013-01-29 15:11:30

10. Hello Ramlak, I am too getting
java.lang.U

View Tutorial          By: Amruta at 2008-11-07 23:56:17