11 Constructors & Enum

11.1 | Constructors


Constructor declarations are similar to method declarations. However, constructors name must be the same as the class name and it cannot return a value. The main objective of a constructor is to set the initial state of an object. When the object is created by using the new operator. The following code shows how to declare constructors with and without input parameters.


Constructor Class



11.2 | ENUM


Enum is a Java keyword used to represent a fixed number of well-known values. For example, the number of days in a week, the number of planets in the solar system, etc.

  
Example 11.2.1 Simple enum of weekdays.

Enum Class




Example 11.2.2 Simple enum of weekdays with weekday number


Enum Class




Example 11.2.3 An enum defining weekday full name and weekday number


Enum Class









9 comments:

nilashri said...

Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
Devops training in Chennai

Devops training in Bangalore

Devops training in Pune

Devops training in Online

Devops training in Pune

Devops training in Bangalore

Devops training in tambaram

Devops training in Sollonganallur

Deops training in annanagar

Devops training in chennai

Mounika said...

This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb. This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolite festivity to pity. I appreciated what you ok extremely here.
python training in rajajinagar
Python training in btm
Python training in usa
Python training in marathahalli

Anonymous said...

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command

angularjs Training in electronic-city

angularjs online Training

angularjs Training in marathahalli

angularjs interview questions and answers

angularjs Training in bangalore

angularjs Training in bangalore

Sadhana Rathore said...

These interview questions were helpful for beginners. Thanks for taking time to share this.
Data Science Training in Chennai
Big Data Analytics Courses in Chennai
Machine Learning Training in Chennai
Microsoft Azure Training in Chennai
DevOps Training in Chennai
AWS Training in Chennai
Data Science Training in Adyar

jefrin said...

Very impressive thanks for posting

Best DevOps Training Institute in Chennai

Sugantha Raja said...

Good Post! Thank you so much for sharing such a wonderful blog.

Python Training in Chennai | Python Training Institute in Chennai

Bangalore Training Academy said...

Your topic is very nice and helpful to us … Thank you for the information you wrote.

Learn Hadoop Training from the Industry Experts we bridge the gap between the need of the industry. Bangalore Training Academy provide the Best Hadoop Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
Big Data Analytics Training in Bangalore
Tableau Training in Bangalore
Data Science Training in Bangalore
Workday Training in Bangalore

sai said...

Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
cyber security course training in guduvanchery

John said...

You should be a part of a contest for one of the highest quality sites on the net. I’m going to highly recommend this blog! The training and certification courses to get trained on microtek training. I got really cleared my doubts by reading your informative information.