单项选择题
A.javac B.jdb C.javadoc D.junit
A.UML类图定义了一组符号用于表示对象技术的抽象,例如类、对象等 B.一个UML类图代表一个类 C.UML的详细类图中包括类名、字段、构造器和方法 D.UML的简要类图包括类名、字段和方法
类Student的声明如下: package com.school class Student{ String name; int age; Student(String name,int age){ //code } void study(String subject){ / /code } } 正确调用方法study(String subject)的是哪项?()
A.Student stu = new Student(“Tom”,23); stu.study(“数学”); B.Student.study(“数学”); C.Student stu = new Student(“Tom”,23); stu.study(); D.Student stu = new Student(“Tom”,23); String result=stu.study(“数学”);
import java.io.PrintWriter; class DoFormat { public static void main(String [] args) { int x = 42; int y = 12345; float z = 7; System.out.format("-%4d- ", x); System.out.format("-%4d- ", y); System.out.format("-%4.1d- ", z); } } 结果为:()
A.编译失败 B.-42- -1234- -7.0- C.- 42- -1234- - 7.0- D.运行时异常被抛出
微信扫一扫,加关注免费搜题