Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For Java 41. Some code that you are modifying calls random.nextGaussian()and you

ID: 3596318 • Letter: F

Question

For Java

41. Some code that you are modifying calls random.nextGaussian()and you want to know what the method does. The object random is of type SecureRandom (defined in java.security.SecureRandom), so you look it up in the Java SDK documentation. The method nextGaussian() is not listed with this type. Where should you look next to find its description?

a.in the code comments

b.in a superclass of the class in which the call is made

c.in the superclass of java.security.SecureRandom, per the documentation

d.in any subclasses of java.security.SecureRandom or of the current class

42. The principle of least privilege means restricting access as much as possible. Declaring a variable as _________ often violates this principle.

a.final

b.private

c.public

d.static

43. Use of the keyword extends indicates implementation of the object-oriented concept of _____.

a.an interface

b.inheritance

c.composition

d.an object

44. In Java, the automatically supplied (default) constructor __________ requires arguments.

a.always

b.sometimes

c.optionally

d.never

Explanation / Answer

41. c.in the superclass of java.security.SecureRandom, per the documentation

We need to check in super class of securerandom

42.c.public

It oftern violates this principle as it is defined as public.

43. b.inheritance

Extend means using existing and adding some more feature. This is called inheritance.

44. d.never

It no arugment is required for automatically supplied constructor

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote