String s = (Double.valueOf("3.1415926")).toString();
举一反三
- 下列哪个语句将双精度值d转换为字符串s? A: s = (new Double(d)).toString(); B: s = (Double.valueOf(s)).toString(); C: s = new Double(d).stringOf(); D: s = String.stringOf(d);
- 下列声明常量的语句中,正确的是( ) A: double PI=3.1415926; B: const double PI=3.1415926; C: static double PI=3.1415926; D: static const double PI=3.1415926;
- 在C#中,下列常量定义正确的是 A: define PI 3.1415926 B: Const double PI=3.1415926 C: Const double PI 3.1415926 D: define double PI=3.1415926
- 阅读程序,下面的哪个选项是正确的?( )。 class ExSuper{ String name; String nick_name; public ExSuper(String s,String t) { name = s; nick_name = t; } public String toString(){ return name; } } public class Example extends ExSuper{ public Example(String s,String t){ super(s,t); } public String toString(){ return name +"a.k.a"+nick_name; } public static void main(String args[]){ ExSuper a = new ExSuper(“First”,“1st”); ExSuper b = new Example(“Second”,“2nd”); System.out.println(“a is”+a.toString()); System.out.println("b is"+b.toString()); } }
- 在C#中,下列常量定义正确的是【 】 A: const double PI 3.1415926 B: const double Pi=2.7 C: define double PI 3.1415926 D: define double e=2.7