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

46 enum AccountType { SAVING, FIXED, CURRENT; private AccountType() { System.out

ID: 3714295 • Letter: 4

Question

46    enum AccountType {          SAVING, FIXED, CURRENT;          private AccountType() {

             System.out.println("It is a account type");

         }            }     class EnumOne {

      public static void main(String[] args) {         System.out.println(AccountType.FIXED);    

      }     }

Options :

Compiles fine and output is prints "It is a account type" once followed by "FIXED"

Compiles fine and output is prints "It is a account type" twice followed by "FIXED"

Compiles fine and output is prints "It is a account type" thrice followed by "FIXED"

Compiles fine and output is prints "It is a account type" four times followed by "FIXED"

Compilation fails

Explanation / Answer

Answer:

Compiles fine and output is prints "It is a account type" thrice followed by "FIXED"

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