wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ZZTECHZZ

Total questions: 57

Worksheet time: 29mins

Name
Class
Date
1.

Which type of relation in the class diagram affects between classes (and not their instances)?

a)

Inheritance

b)

Association

c)

Dependency

d)

Composition

2.

How can you achieve if there are many classes in a class diagram to make their relationship cleared?

a)

We do not indicate the properties of the relationships (multiplicity, role name, etc.)

b)

We split up the diagram.

c)

By omitting the details (attributes, operations).

d)

We print the diagram in a smaller size.

3.

When do we list a method in a derived class, if a method of the same name exists in the parent class?

a)

Always.

b)

If we declare or override it in the derived class.

c)

Only in case of method overriding.

d)

If the method does an important activity (not setter / getter, etc.)

4.

When is the method of the parent class visible in the derived class?

a)

Always.

b)

Only, if it is public.

c)

If we refer to it with the super keyword.

d)

If it is public or protected.

5.

What is true about the dependency relation?

a)

Weak association.

b)

The dependent object cannot create an instance of the class that generates the dependency.

c)

Strong association.

d)

No answer text provided.

6.

Which statement is false about generalization?

a)

Java allows multiple generalizations, if we do not implement more than one interface.

b)

Java does not allow multiple generalization.

c)

Generalization is the opposite of specialization.

d)

In Java, we express it with the keyword extends.

7.

What can be a generic parameter in Java?

a)

Classes that implement the methods used by the generic.

b)

Any type.

c)

Any type that implements the methods used by the generic.

d)

Classes.

8.

Which is considered an abstraction method?

a)

Both.

b)

Usage of abstract methods.

c)

Usage of generic classes.

d)

None of these.

9.

Can a generic class have an abstract method?

a)

No.

b)

Yes.

10.

Can an abstract class have a generic method?

a)

Yes.

b)

No.

11.

Which statement is false?

a)

The collection groups any amount of data.

b)

The type of data stored in the collection is the same.

c)

In case of primitive types, we can instantiate the collection with the wrapper class of the primitive type.

d)

Arrays are not collections.

12.

What data members can a static method use within its own class?

a)

Members, that have getters

b)

Static members

c)

All members

d)

Static and public members

13.

What can't we use a static attribute for?

a)

For object attributes

b)

To define flags

c)

To define constant values

d)

For values shared by objects in the class

14.

What types of exceptions must be caught or indicated?

a)

None of the exceptions should be caught or indicated

b)

Exception and RuntimeException

c)

RuntimeException

d)

Exception

15.

How can we define a custom exception?

a)

We create an enum which contains the types of errors

b)

We create a simple class

c)

We cannot do that

d)

We derive our exception type from class Exception

16.

Which statement is false about the serialization implemented by Java Serializable?

a)

We can take a snapshot of the objects with it.

b)

Serialization saves both the state and relationships of an object and can deserialize them automatically.

c)

A typical tool to realize Remote Method Invokation (RMI).

d)

We can create a binary representation of the object.

17.

What is the super class of the Swing controls?

a)

JObject

b)

JFrame

c)

JControl

d)

JComponent

18.

Which class represents the window in the Swing environment?

a)

JFrame

b)

JWindow

c)

JPanel

d)

JDialog

19.

Which method is used to define the behavior, that takes effect when we close the window?

a)

enableExitOnClose(...)

b)

setAutoClose(...)

c)

setDefaultCloseOperation(...)

d)

setCloseBehavior(...)

20.

Which pairs can be used to handle window events?

a)

addWindowListener method - WindowEvents implementation

b)

addWindowEvents method - WindowAdapter implementation

c)

addWindowEvents method - WindowEvents implementation

d)

addWindowListener method - WindowAdapter implementation

21.

Which statement is true? The window icon file ...

a)

...should be placed inside of the project folder always.

b)

...can be loaded both from the JAR of the program and from the file system the same way.

c)

...loading can be guaranteed to work always, if we place it in the JAR of the program.

d)

...could only be a bmp or ico file.

22.

Which method can be used to add a mouse click handler to a Swing component?

a)

addMouseListener

b)

addMouseWheelListener

c)

addMouseClickListener

d)

addMouseMotionListener

23.

What should we do if we need to handle multiple types of mouse events?

a)

We implement the MouseListener, MouseMotionListener, MouseWheelListener interfaces separately one by one.

b)

We create a class that implements all three interfaces (MouseListener, MouseMotionListener, MouseWheelListener).

c)

We need to add a separate interface implementation for each event.

d)

We derive an event handler class from the MouseAdapter.

24.

What is the basic idea of programs that use event handlers?

a)

While the program is running, certain activities are done as a result of events.

b)

The event object must be defined by the event handler.

c)

Errors are processed as events.

d)

We can respond to mouse clicks in separate functions.

25.

Which statement is false about the event object?

a)

It has a reference to where the event occurred.

b)

The source attribute that contains the source of the event always points to a real object.

c)

Carries the properties of the event.

d)

An appropriate event class can be created for similar types of events.

26.

Which statement is false? The event handler function...

a)

...receives as a parameter the triggered event to which it is currently responding.

b)

...contains the activity to be performed in response to that event.

c)

...used only to handle graphic event events.

d)

...can trigger other events while it is running.

27.

Which statement is true?

a)

The ButtonGroup is used to change the style of the assigned Buttons consistently.

b)

No more than one RadioButton can be selected in a JFrame at a time.

c)

ButtonGroup shows the RadioButtons in a visual frame.

d)

RadioButtons are in mutual exclusion when they are assigned to a ButtonGroup.

28.

The NetBeans designer collects the initialization of visual elements in the following method...

a)

initComponents

b)

initApplication

c)

initControls

d)

initializeComponents

29.

The implementation of the event handler code of a button click can be found in the following interface

a)

ActionListener

b)

ButtonClickListener

c)

EventClickListener

d)

ActionHandler

30.

Which method of ActionListener should be implemented when we handle a button event?

a)

onEvent

b)

handleClick

c)

onClick

d)

actionPerformed

31.

What is true about the JList control?

a)

JList stores the data, that has to be showned.

b)

The default model for JList is DefaultContainerModel.

c)

The type of data stored in the JList model is String.

d)

In the JList control, the selection of an element can be detected via the valueChanged event.

32.

Which method of JTextField can be used to get the edited text?

a)

getText

b)

getContent

c)

setText

d)

setContent

33.

Which interface should be implemented if we want to be notified of a change in the value of the Slider?

a)

ChangeListener

b)

ValueChangedListener

c)

StateChangeListener

d)

ScrollListener

34.

Which method is used to obtain the content of a BufferedImage to draw on it?

a)

getContent

b)

getGraphics

c)

getBitmap

d)

getImage

35.

In which method can we redefine the drawing of a Swing UI component?

a)

paintComponent

b)

drawComponent

c)

paint

d)

draw

36.

Which method of Graphics2D can we use to draw? (Which one is an existing method?)

a)

drawPie

b)

fillRectangle

c)

drawRoundRect

d)

clearRectange

37.

Which statement is part of the Data Query Language?

a)

SELECT * FROM table

b)

UPDATE table SET ...

c)

CREATE TABLE tablename(...)

d)

INSERT INTO table (...) VALUES (...)

38.

What is the Connection rollback () method used for?

a)

Undoes database changes made since the connection was established.

b)

Revokes a user's access rights.

c)

Undoes the last transaction that was started but not yet committed.

d)

Cancels the last issued change request.

39.

Which method call is incorrect on the rs variable of type ResultSet?

a)

rs.getString(5);

b)

rs.getInt(2);

c)

rs.getInt(0);

d)

rs.getString("ADDR");

40.

What do we call as Dirty Read?

a)

Reading non committed data.

b)

Reading data stored in the wrong format.

c)

We are requesting too much data from the database manager.

d)

Reading finalized data.

41.

What is true about a good database?

a)

Ensures data integrity.

b)

All columns in each table are indexed.

c)

May contain redundancy.

d)

Keys can only consist of a single field.

42.

What type does JPasswordField use to store data?

a)

byte[]

b)

char[]

c)

String Character[]

d)

String

43.

Which statement is true about JTable?

a)

The table has a data object that implements the TableModel interface.

b)

The data is stored in the JTable.

c)

There is no default (abstract) implementation of TableModel.

d)

The fireTableStructureChanged method only invalidates the table structure.

44.

Which methods of TableModel need to be implemented for minimal operation?

a)

getValueAt

b)

getColumnName, getValueAt, getColumnClass

c)

getRowCount, getColumnCount, getValueAt

d)

getValueAt, getColumnName

45.

To display the JTable, the Cell renderer uses the following type - display pair.

a)

Number - TextField

b)

Boolean - CheckBox

c)

Date - DatePicker

d)

ImageIcon, Icon - PictureBox

46.

Which statement is NOT TRUE about the condition?

a)

The state has an identifier so it can be distinguished from the others.

b)

The state of the object can be described by the specific values of the attributes.

c)

The state persists as long as the values of the attributes of the objects satisfy the invariant assigned to the state.

d)

The termination of a state can occur suddenly by itself.

47.

Which statement is FALSE?

a)

When the object terminates, the object enters an out-of-system termination state.

b)

When the object expires, the state of the object is simply cleared.

c)

The termination of the state occurs as a result of an event.

d)

When the state of the object terminates, the object enters another state.

48.

Which statement is true about the state diagram?

a)

The nodes of the state diagram graph are events, the edges are state transitions.

b)

The state diagram can contain several initial states.

c)

A state diagram is a singly connected directed graph.

d)

A state diagram is an undirected graph.

49.

The complexity of the state diagram can be reduced by the following method(s):

a)

Generalization and aggregation of states.

b)

Aggregation of states.

c)

No way.

d)

Generalization of states.

50.

Which statement is true?

a)

The invariant of the aggregated and generalized states are the same.

b)

The invariant of the aggregated state is the disjunction of state invariants of the sub-states.

c)

The invariant of the generalized state is the disjunction of state invariants of the sub-states.

d)

The invariant of the generalized state is the conjunction of state invariants of the sub-states.

51.

How do we mark the rendezvous point on a flowchart like activity diagram?

a)

With a horizontal dashed line

b)

With a rectangle with rounded corners

c)

With a horizontal solid line

d)

With a diamond

52.

In the collaboration diagram, between which objects does the collaboration take place?

a)

Whose life cycle is interconnected.

b)

Instantized by the same object.

c)

Which are connected by an association.

d)

Which are instances of the same class.

53.

Which diagram can be considered as an extension of the collaboration diagram?

a)

Object diagram

b)

Class diagram

c)

Package diagram

d)

Component diagram

54.

How do we mark the argument passed in the collaboration diagram during message sending?

a)

With the envelope icon on the association.

b)

With a small arrow starts from a circle.

c)

With the message ID associated with the association.

d)

With the arrow pointing from the sender to the recipient.

55.

How do we mark on a collaboration diagram if a message has multiple recipients?

a)

With several arrows indicated on the association.

b)

The recipients are indicated by three rectangles that are shifted relative to each other.

c)

With multiplicity.

d)

We do not have the opportunity to do that.

56.

Which is NOT a part of the user case diagram?

a)

Users

b)

User accounts

c)

Usage relations

d)

User cases

57.

How do we mark the user case on the user case diagram?

a)

With a circle

b)

By making the name of the use case underlined

c)

With an ellipse

d)

With a rectangle