2014年5月15日星期四

java has no beginsWith () function ?

determine what the end of a string to have endsWith () function , there is no beginsWith () to determine what that begin with ? I tried it , no, not really it?

import java.util.*;

public class Test
{
public static void main(String[] args)
{
String a = "abcd";
System.out.println(a.beginsWith("a"));
}
}


prompts :

Test.java: 8: error: can not find symbol
System.out.println (a.beginsWith ("a"));
^
symbol : method beginsWith (String)
Location: a variable of type String
1 error
------ Solution -------------------------------- ------------
a.startWiths ("a")
------ Solution ---------------- ----------------------------
a.startsWith ("a");
a class what can go JDK documentation investigation !
------ Solution ---------------------------------------- ----
generally inside the IDE tap, then look at all the ways English is not bad as long as you should be able to find .
------ Solution ---------------------------------------- ----
startsWith
nothing more than to check the java doc
------ Solution ----------------------------- ---------------

api to see more of it .
------ Solution ---------------------------------------- ----
teenager, or API code to knock it dead . Recommended books:
java programming language 8th edition , this book tells the API is very full .
------ For reference only -------------------------------------- -
no , oh, look up documents.
------ For reference only -------------------------------------- -
Thank you , I will take a look at the document .

没有评论:

发表评论