java里面常见的接口与方法

1 .java.lang.Double

static double parseDouble(String s)
Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double.
static int compare(double d1, double d2)
Compares the two specified double values.

 

2. java.lang.Character

 public static boolean isLowerCase(char ch)

 public static boolean isUpperCase(char ch)

 public static boolean isDigit(char ch)

 public static char toLowerCase(char ch)

 public static char toUpperCase(char ch)

 public static boolean isSpaceChar(char ch)

 public static boolean isWhitespace(char ch)

3.  java.lang.Long

   public static long parseLong(String s) throws NumberFormatException

   public static long parseLong(String s,int radix) throws NumberFormatException

Long.parseLong("+42", 10) returns 42L
Long.parseLong("-FF", 16) returns -255L
Long.parseLong("1100110", 2) returns 102L
Long.parseLong("99", 8) throws a NumberFormatException
 

4.java.lang.Boolean

  public static int compare(boolean x,boolean y)

  Boolean.valueOf(x).compareTo(Boolean.valueOf(y))

  public static boolean parseBoolean(String s)

 

5. java.lang.Math
   public static double abs(double a)
  public static int max(int a, int b)
  public static float min(float a,float b)

 

6.java.lang.String

 String(byte[] bytes)  Constructs a new String by decoding the specified array of bytes using the platform's default charset.

 String(byte[] bytes, Charset charset)  Constructs a new String by decoding the specified array of bytes using the specified charset.

 public int length()

 public boolean isEmpty()   Returns true if, and only if, length() is 0.

 public char charAt(int index)

 public byte[] getBytes(Charset charset)

 public boolean contentEquals(CharSequence cs)

  public boolean equalsIgnoreCase(String anotherString)

 public int compareTo(String anotherString)

 public int compareToIgnoreCase(String str)

  public boolean startsWith(String prefix)

public boolean endsWith(String suffix)

 public int indexOf(int ch)

 public int indexOf(String str)

 public String toLowerCase()

 public String toUpperCase()

 public boolean contains(CharSequence s)

 public CharSequence subSequence(int beginIndex, int endIndex)

public String substring(int beginIndex,int endIndex)

 public static String format(String format, Object... args)

 public char[] toCharArray()

 

7. java.lang.StringBuilder

 StringBuilder(CharSequence seq)

 public StringBuilder append(char[] str)

 public StringBuilder append(Object obj)

 public StringBuilder append(String str)

 public String toString()

 public char charAt(int index)

public String substring(int start)
public int indexOf(String str)



java.lang.StringBuilder,java.lang.StringBuffer,java.lang.String 都实现了CharSequence接口
10.A thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. 
11.A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization.

posted @ 2016-10-09 15:35  天空中的蜂蜂  阅读(879)  评论(0编辑  收藏  举报