logo

Crowdly

Browser

Add to Chrome

Questions Bank (1629887 total)

A Java class, Database, contains a public method called printStatistics, which outputs statistical information related to that database. The printStatistics method calls another helper method, calculateMean, which is only ever used in this context - it is never called from outside the Database class.

Declaring the calculateMean method with the public access modifier would be bad program design, as it is an example of...

✅
❌
❌
❌
View this question

Which of the following attributes would be best represented by an enum type in Java?

❌
❌
✅
❌
View this question

A particular Java program has an Enrolment class which holds information about a student's enrolment details. This is contained in a separate StudentAndUnits class. 

This is poor program design, as it is an example of...

❌
❌
❌
✅
View this question

This question is related to the Monster-Zoo multi-class example provided in Week 10 pre-reading materials.

Which of the following Zoo methods would not be adversely affected if the variable numberOfMonsters was public and its integrity was compromised by driver code?

0%
25%
50%
0%
25%
0%
0%
View this question

This question is related to the Monster-Zoo multi-class example provided in Week 10 pre-reading materials.

Does the variable numMonstersInstantiated in the Monster class have to be static to perform its function?

0%
0%
0%
0%
View this question

This question is related to the Monster-Zoo multi-class example provided in Week 10 pre-reading materials.

Should the method getNumMonstersInstantiated in the Monster class be static in order to perform its function?

0%
0%
0%
0%
View this question

You need to create a Java application that stores information about recipes and their nutritional information. Each recipe has a list of ingredients that must be stored by the program, and each ingredient has a name and a number of kilojoules associated with it.

What would be the best class design for the program?

❌
❌
❌
✅
View this question

This question is related to the Monster Zoo multi-class example provided in Week 10 pre-reading materials.

Why are the Date and Food objects immutable?

25%
0%
0%
75%
0%
View this question

❌
✅
❌
❌
❌
View this question

Envie sua solução da Questão 2 na caixa abaixo.

View this question