The Java Language | Module 4

Course Name: The Java Language (Java as a Second Language Specialization)

Course Link: The Java Language

These are The Java Language Week 4 Coursera Answers


Q1. A __________ statement can have a number of possible execution pathsZ

  • switch
  • IF-THEN
  • IF-THEN-ELSE

Answer: switch


Q2. A superclass inherits from _________.

  • the new class
  • a subclass
  • nothing
  • the Java Object

Answer: a subclass


Q3. Which command controls a code block when the IF statement is false?

  • run
  • loop
  • else
  • none of these
Answer: else

Q4. True or false: The code in the FOR loop will execute until the upper limit of the counter is reached.

  • True
  • False
Answer: True

These are The Java Language Week 4 Coursera Answers


Q5. Which primitive data type only has 2 possible values?

  • boolean
  • double
  • char
Answer: boolean

Q6. Which Java keyword creates a class as a superclass?

  • extends
  • super
  • implement
  • is
Answer: extends

Q7. If class A extends class B, then class A will have class B’s _______ and _______. (Select all that apply).

  • methods
  • properties
  • subclasses
  • all of these
Answer: methods, properties

Q8. A variable’s data type determines the ________ it may contain, plus the operations that may be performed on it.

  • primitives
  • keywords
  • values
Answer: values

Q9. _________ is a data structure that holds multiple values of the same data.

  • An array
  • A group
  • A class
Answer: An array

Q10. When does the code block in an IF statement execute?

  • when the IF statement is true
  • always
  • when part of the statement is true
  • when the IF statement is false
Answer: when the IF statement is true

These are The Java Language Week 4 Coursera Answers

See also  Writing Java Application Code | Module 2

More Weeks of the course: Click Here

More Coursera courses: https://progiez.com/coursera

These are The Java Language Week 4 Coursera Answers