14.Specify the error in following program? public enum Enums { NORTH, SOUTH, WEST, EAST; private Enums() { System.out.pr

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
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

Post by answerhappygod »

14 Specify The Error In Following Program Public Enum Enums North South West East Private Enums System Out Pr 1
14 Specify The Error In Following Program Public Enum Enums North South West East Private Enums System Out Pr 1 (58.17 KiB) Viewed 29 times
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply