nerdexam
Oracle

1Z0-803 · Question #17

Which two may precede the word "class" in a class declaration?

The correct answer is B. public C. static. B: A class can be declared as public or private. C: You can declare two kinds of classes: top-level classes and inner classes. You define an inner class within a top-level class. Depending on how it is defined, an inner class can be one of the following four types:Anonymous, Loca

Java Basics

Question

Which two may precede the word "class" in a class declaration?

Options

  • Alocal
  • Bpublic
  • Cstatic
  • Dvolatile
  • Esynchronized

How the community answered

(42 responses)
  • A
    2% (1)
  • B
    95% (40)
  • E
    2% (1)

Explanation

B: A class can be declared as public or private. C: You can declare two kinds of classes: top-level classes and inner classes. You define an inner class within a top-level class. Depending on how it is defined, an inner class can be one of the following four types:Anonymous, Local, Member and Nested top-level. A nested top-level class is a member classes with astaticmodifier. A nested top-level class is just like any other top-level class except that it is declared within another class or interface. Nested top-level classes are typically used as a convenient way to group related classes without creating The following is an example: public class Main { static class Killer {

Topics

#class modifiers#access modifiers#static keyword

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice