从Java 5开始,Java中引入了枚举类型,expr也可以是enum类型,从Java 7开始,expr还可以是字符串(String),但是长整型(long)在目前所有的版本中都是不可以的。 switch-case语句完全可以与if-else语句互转,但通常来说,switch-case语句执行效率要高。 default在当前switch找不到匹配的case时执行。default并不是必须的。
StringBuffer s = new StringBuffer(); // Class studentClass = Class.forName("com.java.bean.Student"); Class studentClass = Class.forName("java.lang.String"); // s.append("public class Student{"); s.append(Modifier.toString(studentClass.getModifiers())+" class "+studentClass.getSimpleName...
voidsetLocation(Stringlocation) The URL of the public key. voidsetPublicKey(PublicKeypublicKey) The public key. StringtoString() Returns a string representation of this object. CreatePublicKeyResultwithETag(StringeTag) The identifier for this version of the public key. ...
public String toString() Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. Overrides: toString in class Object Returns: A string representation of this object. See Also: Object.toStr...
public String toString(String charset) throws UnsupportedEncodingException Convert this byte string to a standard string. Parameters: charset - the character set to use Returns: the standard string Throws: UnsupportedEncodingException - if the charset is unknown length publi...
public String ipPrefix() Get the ipPrefix property: The allocated Prefix. Returns: the ipPrefix value.ipTags public List ipTags() Get the ipTags property: The list of tags associated with the public IP prefix. Returns: the ipTags value.load...
Methods inherited from ExpandableStringEnum <T>fromString <T>values equals hashCode toString Methods inherited from java.lang.Object clone finalize getClass notify notifyAll wait wait wait Field Details BUILDING public static final WorkloadNetworkPublicIpProvisioningState BUILDING Stati...
Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor Detail ServiceInstanceType public ServiceInstanceType() Method Detail getDescription public java.lang.String getDescription() Gets the value of the descriptio...
public String id() Get the id property: Resource ID. Overrides: PublicIpPrefixInner.id() Returns: the id value.ipPrefix public String ipPrefix() Get the ipPrefix property: The allocated Prefix. Returns: the ipPrefix value.ipTags public List ipTags() Get the ipTags property: The list ...
(cause == null ? null : cause.toString()) (which typically contains the class and detail message of cause). Parameters: cause - the cause (which is saved for later retrieval by the Throwable.getCause() method) BrokenPipeException public BrokenPipeException(String ...