Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
mcq.docx
Скачиваний:
12
Добавлен:
25.02.2016
Размер:
29.56 Кб
Скачать
    • None

    • I only

    • I and II

    • II only

  • In a strategy design pattern, the desired algorithm is specified and invoked via a(n)

    • strategy interface

    • algorithm class

    • singleton class

    • context class

  • What kinds of abstract classes, if any, can be instantiated?

    • Those that contain only abstract methods

    • Those that contain no abstract methods

    • Those that contain at least one method that is not abstract

    • None

  • In Java, for a subclass of an abstract class not to be abstract, the subclass must override which of the following?

  • All inherited abstract methods

  • All inherited methods that are not abstract

    • I and II

    • II only

    • None

    • I only

  • Consider the following line of Java code.

PrintWriter fileOut =

new PrintWriter(new FileWriter("out.txt", true));

Which of the following is (are) true about the result of executing the line of code?

  • If the file out.txt exists, its contents will be erased.

  • If the file out.txt does not exist, it will be created.

    • I and II

    • None

    • I only

    • II only

  • Which of the following is (are) true regarding file input in Java?

  • FileReader and BufferedReader are defined in the package java.lang.

  • A BufferedReader object can receive data from a FileReader object.

  • A BufferedReader object can read entire lines of data.

    • I, II, and III

    • I and III only

    • I and II only

    • II and III only

  • In Java, which of the following registers a listener for a radio button click event?

    • actionPerformed

    • ActionEvent

    • addEventListener

    • addActionListener

  • Which of the following is a line of code that registers a named inner class as an event listener for a JList object in Java?

    • addListSelectionListener(this);

    • addActionListener(new ListListener());

    • addActionListener(this);

    • addListSelectionListener(new ListListener());

  • In Java, which of the following is (are) true regarding JTextArea objects?

  • They support background and foreground colors.

  • They have built-in scrollbar capability.

  • They can be read-only.

    • I and II only

    • II and III only

    • I, II, and III

    • I and III only

  • Which of the following is (are) true regarding event handling in Java?

  • A single listener object can be registered to handle all button presses in an application.

  • A different listener object can be registered with each button in an application.

    • I only

    • II only

    • None

    • I and II

  • In Java, which of the following terminates a program?

    • windowClosing()

    • actionPerformed()

    • dispose()

    • System.exit(0)

  • A user clicking a JButton component in Java generates which of the following events?

  • Action

  • Mouse pressed

  • Mouse clicked

    • I only

    • I and II only

    • II and III only

    • I, II, and III

  • Which of the following is a Java layout manager that automatically wraps components to the next available row if they cannot fit on the current row?

    • BorderLayout

    • GridLayout

    • GridBagLayout

    • FlowLayout

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]