使用当前浏览器访问考试宝,无法享受最佳体验,推荐使用 Chrome 浏览器进行访问。
更新时间: 试题数量: 购买人数: 提供作者:
有效期: 个月
章节介绍: 共有个章节
我的错题 (0道)
我的收藏 (0道)
我的斩题 (0道)
我的笔记 (0道)
顺序练习 练习进度 0 / 0
随机练习 自定义设置练习量
模拟考试 仿真模拟
题型练习 按题型分类练习
易错题 精选高频易错题
学习资料 考试学习相关信息
String foo = "blue";
boolean[] bar = new boolean[1];
if(bar[0]){
foo = "green";
}
System.out.println(foo);
String s = "COMPUTER";
System.out.println(s.substring(3,6));
String s = "ABC";
System.out.print(s.charAt(3));
import java.io.IOException;
public class Test{
public static void methodA() {
throw new IOException();
public static void main(String[] args){
try{
methodA();
}catch(IOException e){
System.out.println("Caught Exception");
TreeSet<String> mySet = new TreeSet<>(); mySet.add("one");
mySet.add("two");
mySet.add("three");
mySet.add("four");
mySet.add("one");
Iterator<String> it = mySet.iterator();
while(it.hasNext()){
System.out.println(it.next()+" ");
import java.util.*;
public class SortOf{
public static void main(String[]args){ ArrayList<String> a = new ArrayList<>(); a.add(1);
a.add(5);
a.add(3);
Collections.sort(a);
a.add(2);
Collections.reverse(a);
System.out.println(a);
public class Outer{
class Inner{
public void go(){
System.out.print("hi");
int i = 1, j = 0 ;
switch(i) {
case 1: j += 6;
case 2: j += 1;
default: j += 2;
System.out.println(j);
public class Test {
static void leftshift(int i, int j){
i <<= j;
int i = 4, j = 2;
leftshift(i,j);
System.out.println("i = "+ i);
class AB{
int a , b ;
public void init(int x){
a = x ;
int b = 5 ;
public void display(){
System.out.println("a = "+a+" b = "+b);
public class ABTest{
AB ab = new AB();
ab.init(6);
ab.display() ;
下列程序段的运行结果为
int [][]x ={{1,2},{3,4,5},{6,7,8,9}};
int[][]y = x;
System.out.println(y[2][1]);
执行下列语句后输出的结果是
System.out.println(s.indexOf(‘M’));
class AA{
AA(int a){
System.out.print(a);
class BB extends AA{
BB(String s){
super(88);
System.out.print(s);
public class ConstructorDemo{
BB b = new BB("hello");
class Super{
public int i = 0;
public Super(String text){
i = 1;
public class Sub extends Super{
public Sub(String text){
super(“”);
i = 2;
Sub sub = new Sub("Hello");
System.out.println(sub.i);
下面代码在运行时会产生什么异常
int m = 100;
System.out.println(m / 0);