• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
JAVA题库:格林模拟试题三(下)(3)
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
JAVA题库:格林模拟试题三(下)(3)
软件发布 JAVA题库:格林模拟试题三(下)(3)
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 认证考试 >> JAVA认证 >> JAVA题库 >> JAVA题库:格林模拟试题三(下)(3)

JAVA题库:格林模拟试题三(下)(3)

添加时间: 2007-9-22 8:06:30  作者: JAVA认证考试  阅读次数:53   来源: http://www.d9soft.com

       

Question 52)
You have been asked to create a scheduling system for a hotel and catering organsiation.

You have been given the following information and asked to create a set of classes to represent it.

On the catering side of the organsiation they have

Head Chefs
Chefs
Apprentice Chefs

The system needs to store an employeeid, salary and the holiday entitlement

How would you best represent this information in Java e been given the following information and asked to create a set of classes to represent it.

How would you best represent this information in Java

1) Create classes for Head Chef, Chef, Apprentice Chef and store the other values in fields
2) Create an employee class and derive sub classes for Head Chef, Chef, Apprentice Chef and store the other values in fields.
3) Create and employee class with fields for Job title and fields for the other values.
4) Create classes for all of the items mentioned and create a container class to represent employees

Question 53)
You need to read in the lines of a large text file containing tens of megabytes of data. Which of the following would be most suitable for reading in such a file

1) new FileInputStream("file.name")
2) new InputStreamReader(new FileInputStream("file.name"))
3) new BufferedReader(new InputStreamReader(new FileInputStream("file.name")));
4) new RandomAccessFile raf=new RandomAccessFile("myfile.txt","+rw");

Question 54)
What will happen when you attempt to compile and run the following code?

public class Inc{
public static void main(String argv[]){
                Inc inc = new Inc();
                int i =0;
                inc.fermin(i);
                i = i++;
                System.out.println(i);
        }
        void fermin(int i){
                i++;
        }
}
1) Compile time error
2) Output of 2
3) Output of 1
4) Output of 0

Question 55)
What will happen when you attempt to compile and run the following code?

public class Agg{
static public long i=10;
public static void main(String argv[]){
        switch(i){
                default:
                System.out.println("no value given");
                case 1:
                System.out.println("one");
                case 10:
                System.out.println("ten");
                case 5:
                System.out.println("five");
        }
    }
}
1) Compile time error
2) Output of "ten" followed by "five"
3) Output of "ten"
4) Compilation and run time error because of location of default

Question 56)
Given the following class

public class ZeroPrint{
public static void main(String argv[]){
        int i =0;
        //Here 
        }
}
Which of the following lines if placed after the comment //Here will print out 0.

1) System.out.println(i++);
2) System.out.println(i+'0');
3) System.out.println(i);
4) System.out.println(i--);

Question 57)
Given the following code

class Base {}

class Agg extends Base{
        public String getFields(){
         String name =  "Agg";
        return name;
        }
}


public class Avf{
public static void main(String argv[]){
        Base a = new Agg();
        //Here
        }
}
What code placed after the comment //Here will result in calling the getFields method resulting in the output of the string "Agg"?

1) System.out.println(a.getFields());
2) System.out.println(a.name);
3) System.out.println((Base) a.getFields());
4) System.out.println( ((Agg) a).getFields());

Question 58)
What will happen when you attempt to compile and run the following code.

public class Pvf{

static boolean Paddy;
public static void main(String argv[]){
        System.out.println(Paddy);
        }

}
1) Compile time error
2) compilation and output of false
3) compilation and output of true
4) compilation and output of null

Question 59)
Which of the following statements are true?

1) The x,y coordinates of an instance of MouseEvent can be obtained using the getX() and getY() methods
2) The x,y coordinates of an instance of MouseEvent can be obtained using the X and Y integer fields
3) The time of a MouseEvent can be extracted using the getTime() method
4) The time of a MouseEvent can be extracted using the getWhen method

Question 60)
Given the following code

import java.io.*;

public class Ppvg{
public static void main(String argv[]){
        Ppvg p = new Ppvg();
        p.fliton();
        }
        public int fliton(){
        try{
                FileInputStream din = new FileInputStream("Ppvg.java");
                din.read();
        }catch(IOException ioe){
  System.out.println("flytwick");      
         return 99;
        }finally{
         System.out.println("fliton");
         }
        return -1;
        }
       
}
Assuming the file Ppvg.java is available to be read which of the following statements are true if you try to compile and run the program?

1) The program will run and output only "flytwick"
2) The program will run and output only "fliton"
3) The program will run and output both "fliton" and "flytwick"
4) An error will occur at compile time because the method fliton attempts to return two values

 

上下文章:

 

上一篇文章: JAVA题库:格林模拟试题三(下)(2) 下一篇文章: JAVA题库:格林模拟试题一(上)(1)

相关文章:

  • 用3ds max模拟香烟烟丝飘动的效果
  • DW CS4 JavaScript的部分新特性
  • EA公布《模拟人生3》海量游戏截图
  • 教你如何用PS滤镜巧妙模拟做出下雪效果
  • Oracle加入Grails开源计划提升Java生产力

相关软件:

  • AutoJava Java代码自动生成工具 V1.0
  • 计算机等级考试训练模拟软件(三级数据库技术) V1.01
  • 历年高考化学试题库 V6.4 贺岁版
  • 中、高考英语试题库 V6.4 贺岁版
  • 金排题库系统 2009 专业版
  • Java Decompiler (JD-GUI) 0.2.5 For MacOS X

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

JAVA认证分类导航

  • JAVA动态
  • JAVA指导
  • JAVA题库

本类经典文章推荐

  • SCJP模拟试题[2](2)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](2)
  • SCJP Mock Exam 3(1)
  • SCJP考试题310-025[5](1)
  • Java网络编程之URI、URL研究专题一
  • Java认证模拟题及分析(1)
  • SCJP模拟试题[1](3)
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[2](3)

JAVA题库阅读排行

  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你4
  • JAVA题库:考考你2
  • SCJP考试真题和解析[1](2)
  • Java认证模拟题及分析(3)
  • Java认证模拟题及分析(1)
  • SCJP考试真题和解析[1](1)
  • SCJP模拟试题[2](1)
  • JAVA题库:格林模拟试题一(上)(2)
  • SCJP模拟试题[2](3)

JAVA认证阅读总排行

  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你4
  • JAVA题库:考考你2
  • SCJP考试真题和解析[1](2)
  • Java认证模拟题及分析(3)
  • Java认证模拟题及分析(1)
  • SCJP考试真题和解析[1](1)
  • SCJP模拟试题[2](1)
  • JAVA题库:格林模拟试题一(上)(2)
  • SCJP模拟试题[2](3)

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有