Java Standard Edition 5 and 6, Certified Associate Exam v6.0 (1z0-850)

Page:    1 / 17   
Total 242 questions

Given:
interface Writable { }
interface Erasable { }
Which three are valid? (Choose three.)

  • A. public class Pencil implements Erasable,Writable { /*...*/ }
  • B. public interface Pencil extends Writable { /*...*/ }
  • C. public interface Pencil implements Writable { /*...*/ }
  • D. public class Pencil implements Writable { /*...*/ }
  • E. public class Pencil extends Writable { /*...*/ }


Answer : A,B,D

A Java programmer wants to develop a small application to run on mobile phones. Which
Java edition (or editions) are required to develop the application?

  • A. only J2ME
  • B. J2SE and J2EE
  • C. only J2EE
  • D. J2SE and J2ME
  • E. only J2SE
  • F. J2EE and J2ME


Answer : D

Which Java technology provides a standard API for relational database access?

  • A. JDC
  • B. JMS
  • C. JSP
  • D. JNDI
  • E. JDBC


Answer : E

Which is true?

  • A. You must use JDBC to connect an RDBMS to a Java application.
  • B. JDBC is designed to provide a bridge between servlets and EJB technology.
  • C. Classes in the JDBC API include implementations of JDBC drivers.
  • D. The JDBC API is located within the java.sql and javax.sql packages.


Answer : D

Which package contains classes to read from, and write to, files?

  • A. java.net
  • B. javax.swing
  • C. javax.file
  • D. java.util
  • E. java.io
  • F. java.lang
  • G. java.stream


Answer : E

Which two are characteristics of applets? (Choose two.)

  • A. Because it executes on the web server, the client does NOT incur the processing overhead.
  • B. Applet security is provided by Java's sandbox security model.
  • C. Applets can be developed quickly using HTML/JavaScript tags.
  • D. Because code is downloaded at the time of execution, applets are easy to distribute.


Answer : B,D

Which two are benefits of servlets? (Choose two.)

  • A. They allow you to embed Java code in HTML files.
  • B. They represent data in a persistent store.
  • C. They can produce dynamic content in response to web client requests.
  • D. Their lifecycles are managed by the container.


Answer : C,D

Which four are legal declarations? (Choose four.)

  • A. String st = null;
  • B. String st = "Hello";
  • C. String st == 'Hello';
  • D. String st = 'Hello';
  • E. String st == "Hello";
  • F. String[] st = new String[1];
  • G. String st = new String("Hello");


Answer : A,B,F,G

Given:
1. class Test {
2. public static void main(String args[]) {
3. int i = 1;
4. while (i-- > 1) {
5. System.out.println("i : " + i);
6. }
7. }
8. }
What is the result?

  • A. i : 1
  • B. i : -1
  • C. i : 0
  • D. No output is produced.
  • E. Compilation fails.


Answer : D

What keyword is used to create an enumeration?

  • A. ENUM
  • B. const
  • C. enumeration
  • D. There is no keyword for creating enumerations. The Enum class must be used instead.
  • E. enum


Answer : E

Click the Exhibit button. Which correctly implements the relationship shown in the diagram?

  • A. class Cat { Dog d; } class Dog { }
  • B. class Cat { } class Dog { Cat c; }
  • C. class Cat { } class Dog { }
  • D. class Cat { Dog d; } class Dog { Cat c; }


Answer : D

Which Java technology provides a unified interface to multiple naming and directory services?

  • A. JNI
  • B. EJB
  • C. JDBC
  • D. JNDI
  • E. JavaMail


Answer : D

Given:
1. class Book {
2. public String title;
3.
4. public void setTitle(String title) {
5. if (checkTitle(title)) this.title = title;
6. }
7. public String getTitle() {
8. return title;
9. }
10. private boolean checkTitle(String newTitle) {
11. // code that verifies proposed title change
12. }
13. }
Which two are true? (Choose two.)

  • A. The title attribute is protected from direct modification by outside code.
  • B. The Book class demonstrates encapsulation.
  • C. The Book class does NOT provide information hiding.
  • D. The Book class adheres to the JavaBeans naming conventions.
  • E. The checkTitle method can be accessed from outside the Book class.


Answer : C,D

Which is true about MIDlets?

  • A. MIDlet devices are not required to allow applications to be uninstalled.
  • B. The only API used to create MIDlets is the MIDP API.
  • C. Devices that support MIDlets must allow the MIDlets to access the device's low-level functions.
  • D. Devices that run MIDlets must provide software that manages wireless downloading of applications.


Answer : D

Which two are characteristics of an RDBMS? (Choose two.)

  • A. An RDBMS represents data using three-dimensional tables.
  • B. J2EE provides a cross-platform RDBMS.
  • C. Java technologies provide capabilities for connecting a legacy RDBMS to a web application.
  • D. Business-tier applications use session beans to represent rows in an RDBMS.
  • E. An RDBMS represents data using two-dimensional tables.


Answer : C,E

Page:    1 / 17   
Total 242 questions