DATA STRUCTURES AND JAVA CLASS LIBRARY
DLBCSDSJCL01 – Q&A
Unit 1
Q1 - What is the purpose of comments?
Comments summarize the meaning and purpose of lines of code and facilitate understanding of the
program code.
Q2 - Which of these describes a way that lines of code can be distinguished from comment lines
in Java?
Single-line comments are introduced with a double slash and end with the next line break.
Q3 - In which order are the elements of a class typically arranged?
static variables and methods, instance variables, constructors, getters and setters, instance
methods
Q4 - Which of these is an advantage of code conventions?
They make it easier for programmers who are new to a project to learn its source code.
Q5 - Javadoc is...
a program and commenting convention.
Unit 2
Q1 - Which of the following statements is correct?
The class Object defines useful methods for comparing objects.
Q2 - What is the method signature for string representation of objects?
String toString()
, Q3 - What is the method signature defined in the class Object for the content comparison of
objects?
boolean equals(Object obj)
Q4 - Which of the following statements about the cloning of objects is true?
To mark a class as cloneable, one must implement the interface Cloneable.
Q5 - Why is overriding the method for string representation of objects useful?
The textual representation of a class is then centrally defined.
Unit 3
Q1 - To import an external package or program library...
the compiled program library is required.
Q2 - The standard class library...
is structured hierarchically into sub-packages.
Q3 - Which of the following does the default class library not contain a package for?
the programming of websites
Q4 - Which of the following statements is correct?
In addition to the API documentation, tutorials and guides for programmers are provided for the
Java class library.
Q5 - Which of the following statements is not correct?
API documentation provides access to the source code of the externally developed library.
DLBCSDSJCL01 – Q&A
Unit 1
Q1 - What is the purpose of comments?
Comments summarize the meaning and purpose of lines of code and facilitate understanding of the
program code.
Q2 - Which of these describes a way that lines of code can be distinguished from comment lines
in Java?
Single-line comments are introduced with a double slash and end with the next line break.
Q3 - In which order are the elements of a class typically arranged?
static variables and methods, instance variables, constructors, getters and setters, instance
methods
Q4 - Which of these is an advantage of code conventions?
They make it easier for programmers who are new to a project to learn its source code.
Q5 - Javadoc is...
a program and commenting convention.
Unit 2
Q1 - Which of the following statements is correct?
The class Object defines useful methods for comparing objects.
Q2 - What is the method signature for string representation of objects?
String toString()
, Q3 - What is the method signature defined in the class Object for the content comparison of
objects?
boolean equals(Object obj)
Q4 - Which of the following statements about the cloning of objects is true?
To mark a class as cloneable, one must implement the interface Cloneable.
Q5 - Why is overriding the method for string representation of objects useful?
The textual representation of a class is then centrally defined.
Unit 3
Q1 - To import an external package or program library...
the compiled program library is required.
Q2 - The standard class library...
is structured hierarchically into sub-packages.
Q3 - Which of the following does the default class library not contain a package for?
the programming of websites
Q4 - Which of the following statements is correct?
In addition to the API documentation, tutorials and guides for programmers are provided for the
Java class library.
Q5 - Which of the following statements is not correct?
API documentation provides access to the source code of the externally developed library.