14.Specify the error in following program? public enum Enums { NORTH, SOUTH, WEST, EAST; private Enums() { System.out.println(1): } } class MainClass { public static void main(String[] args) { Enums dl = new Enums(); } } O a. Have duplicate constants. O b. Have only private constructors. c. Did not declare enum constants with any modifiers O d. Using 'new' operator.
A class in java is a blueprint (template) that consists of instance variables, instance methods, and constructors. Objects are instances/copies of a class. Therefore, which of the following statements are TRUE? i. The methods that retrieve the data of fields in the class are called accessors ii. The methods that modify the data of fields in the class are called mutators. iii. A class may be declared without constructors. iv. Name of constructor always same as name of class Oi & ii O i & ii & iii & ivv Oiii Oii
14.Specify the error in following program? public enum Enums { NORTH, SOUTH, WEST, EAST; private Enums() { System.out.pr
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
14.Specify the error in following program? public enum Enums { NORTH, SOUTH, WEST, EAST; private Enums() { System.out.pr
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!