1 , use the Equals () method to compare two strings for equality. It has a general form such as the following:Boolean equals (Object str)Here str is a string object that is used to make a comparison with the invocation string (String) object.
1. Use the Equals () method to compare the equality of two strings. It has the following general form:Boolean equals (Object str)Here str is a string object that is used to compare to the invocation string (String) object. If two strings have the
1 , use the Equals () method to compare two strings for equality. It has a general form such as the following:Boolean equals (Object str)Here str is a string object that is used to make a comparison with the invocation string (String) object.
1. Use the Equals () method to compare two strings for equality (case-sensitive)2. Use the Equalsignorecase () method to compare two strings for equality (case insensitive)Boolean equalsignorecase (String str)The following examples illustrate the
1. Use the Equals () method to compare the equality of two stringsBoolean equals (Object str)Here str is a string object that is used to compare to the invocation string (String) object.If two strings have the same character and length, it returns
1 , use the Equals () method to compare the equality of two strings. It has the following general form:Boolean equals (Object str)Here str is a string object that is used to compare to the invocation string (String) object. If two strings have the
Java entry (5) -- String/string class, entry String
In the previous example, there was a String example. Some friends certainly didn't know what to do. In fact, the String class is a special class in Java, namely the String class. It is not one of
7.1 stringClass7.2StringbufferClass
7.1 stringClassObjects of the string class cannot be changed once they are created.String constant. In the previous program, we have used the String constant multiple times.For example, "input a integer data/N"
String, string
It mainly involves the StringBuffer class that cannot be changed after the program runs initialization and the StringTokenizer class that can be dynamically changed by the String class String and the String content, and the String
Welcome to visit the blog Create string Create string Object-1
public class Test {public
static void Main (string[] args) {
string s = new string ();//create String
System.out.print ln (s);
}
}
Create a String Object-2
public
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.