好吧这道题我丢脸了,竟然做错了。

如下程序的输出结果是:

class Alligator{
public static void main(String[] args){
int[]x[] = {{1,2},{3,4,5},{6,7,8,9}};
int[][]y = x;
System.out.print(y[2][1]);
}
}

最后输出7。

我是从1开始数的。

scjp考试准备 - 4 - 关于数组的更多相关文章

  1. scjp考试准备 - 3 - 关于Arrays

    判断如下程序的最终输出值: import java.util.*; public class Quest{ public static void main(String[] args){ String ...

  2. scjp考试准备 - 10 - 类型转换

    题目为如下代码的执行结果: class Building{} public class Barn extends Building{ public static void main(String[] ...

  3. scjp考试准备 - 7 - Java构造器

    题目——如下代码的执行结果: class Hello{ String title; int value; public Hello(){ title += " World!"; } ...

  4. scjp考试准备 - 6 - 父类构造器的引用

    题一,如下代码的执行结果: class Person{ String name = "No name"; public Person(String nm){name = nm;} ...

  5. scjp考试准备 - 5 - 重载和重写

    如下代码,在所指示的位置插入代码能够正常编译: class Alpha{ public void bar(int... x){}; public void bar(int x){}; } public ...

  6. scjp考试准备 - 2 - 逻辑运算及类型转换

    判断如下代码的执行结果: public class Spock{ public static void main(String[] args){ Long tail = 2000L; Long dis ...

  7. scjp考试准备 - 1 - 循环控制

    判断如下代码最后的执行结果. public class Breaker{ static String o = ""; public static void main(String[ ...

  8. scjp考试准备 - 11 - 类型转换2

    题目如下: interface Foo{} class Alpha implements Foo{} class Beta extends Alpha{} public class Delta ext ...

  9. scjp考试准备 - 9 - 多态

    题目为如下代码的执行结果: abstract class Vehicle{ public int speed(){ return 0; } } class Car extends Vehicle{ p ...

随机推荐

  1. dell N1500 安全配置

    http://www.dell.com/Support/Article/us/en/19/HOW10832 Setting a management IP address A reachable IP ...

  2. Oracle笔记 八、PL/SQL跳转/判断/循环语句块

    --goto跳转语句 --在goto 后,跳转到相应的语句,然后执行该语句和后面所有语句 begin dbms_output.put_line('goto开始了'); goto c; --不被执行 d ...

  3. c# 字符串(含有汉字)转化为16进制编码(转)

    public static string Str2Hex(string s) { string result = string.Empty; byte[] arrByte = System.Text. ...

  4. boost: tcp client sample

    #include <boost/asio.hpp> #include <iostream> using namespace std; using namespace boost ...

  5. C# 调用控制台程序,并获取输出写入文件

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...

  6. Oracle 中 根据值 查询 所在 表和字段

    -------------------- -- 这里是查询 数字型字段值 /*declare CURSOR cur_query IS select table_name, column_name, d ...

  7. Unieap3.5错误收集

    String index out of range:32 错误描述:Drm查询报错(drm解析报不通过,后台未打印sql) 错误原因:查询SQL中包含字符 <> ,一般用于查询条件 A & ...

  8. banner淡出效果

    <div class="banner"> <div class="ban"></div> <ul class=&quo ...

  9. iptables用法

    iptables -t nat -A PREROUTING -s 10.10.10.0/24 -i eth1 -p tcp --dport 80 -j REDIRECT --to-ports 3128 ...

  10. CentOS 6.x版本升级Mysql

    首先确定一下自己的DNS  vi /etc/resolv.conf    我一般为114.114.114.114 #-----------------------------CentOS 6.x版本升 ...