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









27 comments:

shalinipriya said...

Thanks for one marvellous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.
Data Science Training in Chennai

Data science training in bangalore

online Data science training

Data science training in pune

Data science training in kalyan nagar

Data science training in Bangalore

Data science training in tambaram

Data science training in kalyan nagar

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

DeepikaOrange said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging

Cloud Training
Cloud Training in Chennai

Unknown said...

This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
java training in chennai | java training in bangalore

java training in tambaram | java training in velachery

java training in omr

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

gowsalya said...

Read all the information that i've given in above article. It'll give u the whole idea about it.
Devops training in sholinganallur
Devops training in velachery
Devops training in annanagar
Devops training in tambaram

SRI said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

rpa interview questions and answers
automation anywhere interview questions and answers
blueprism interview questions and answers
uipath interview questions and answers
rpa training in chennai

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

shivam said...


Top engineering colleges in India

raju said...

very nice blogger.......................!!!
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
panama web hosting
syria hosting
services hosting
afghanistan shared web hosting
andorra web hosting
belarus web hosting
brunei darussalam hosting

shree said...

very nice....
inplant training in chennai for it
namibia web hosting
norway web hosting
rwanda web hosting
spain hosting
turkey web hosting
venezuela hosting
vietnam shared web hosting

My Class Training Bangalore said...

Such a great word which you use in your article and article is amazing knowledge. thank you for sharing it.

Best Training Institute in Bangalore BTM. My Class Training Bangalore training center for certified course, learning on Software Training Course by expert faculties, also provides job placement for fresher, experience job seekers.
Software Training Institute in Bangalore

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

shri said...

super post...!
internship in chennai for ece students
internships in chennai for cse students 2019
Inplant training in chennai
internship for eee students
free internship in chennai
eee internship in chennai
internship for ece students in chennai
inplant training in bangalore for cse
inplant training in bangalore
ccna training in chennai


Bangalore Training Academy said...

Thank you so much for the great and very beneficial stuff that you have shared with the world.

Hadoop Training in Bangalore
Hadoop Courses in Bangalore
Hadoop Classes in Bangalore
Hadoop Training Institute in Bangalore
Hadoop Course Syllabus
Best Hadoop Training
Hadoop Training Centers

Bangalore Training Academy said...

It’s really great information for becoming a better Blogger. Keep sharing, Thanks...
Big Data Analytics Training in Bangalore
Big Data Analytics Courses in Bangalore
Big Data Analytics Classes in Bangalore
Big Data Analytics Training Institute in Bangalore
Big Data Analytics Course Syllabus
Best Big Data Analytics Training
Big Data Analytics Training Centers

Bangalore Training Academy said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up...

Tableau Training in Bangalore
Tableau Courses in Bangalore
Tableau Classes in Bangalore
Tableau Training Institute in Bangalore
Tableau Course Syllabus
Best Tableau Training
Tableau Training Centers

Bangalore Training Academy said...

I think this is one of the most significant information for me. And I’m glad reading your article. Thanks for sharing!

Data Science Training in Bangalore
Data Science Courses in Bangalore
Data Science Classes in Bangalore
Data Science Training Institute in Bangalore
Data Science Course Syllabus
Best Data Science Training
Data Science Training Centers

Bangalore Training Academy said...

Very interesting, good job and thanks for sharing such a good blog. Thanks a lot…
Workday Training in Bangalore
Workday Courses in Bangalore
Workday Classes in Bangalore
Workday Training Institute in Bangalore
Workday Course Syllabus
Best Workday Training
Workday Training Centers

sibiselvan said...

it is excellent blogs...!!
inplant training for diploma students
mechanical internship in chennai
civil engineering internship in chennai
internship for b.arch students in chennai
internship for ece students in core companies in chennai
internship in chandigarh for ece
industrial training report for computer science engineering on python
internship for automobile engineering students in chennai
big data training in chennai
ethical hacking internship in chennai

KUTTYMA said...

nice information....

winter internship for engineering students
internship for mca students
inplant training for eee students
inplant training for eee students/
java training in chennai
internships for eee students in hyderabad
ece internship
internship certificate for mechanical engineering students
internship in nagpur for computer engineering students
kaashiv infotech internship
internship for aeronautical engineering students in india 2019

watson said...


Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.

sap abap courses in bangalore

sap abap classes in bangalore

sap abap course syllabus

best sap abap training

sap abap training center

sap abap training institute in bangalore

anuarun said...

nice information......
ree internship in bangalore for computer science students
internship for aeronautical engineering
internship for eee students in hyderabad
internship in pune for computer engineering students 2018
kaashiv infotech internship fees
industrial training certificate format for mechanical engineering students
internship report on machine learning with python
internship for biomedical engineering students in chennai
internships in bangalore for cse
internship in coimbatore for ece

raju said...

very nice blogger thanks for sharing......!!!
poland web hosting
russian federation web hosting
slovakia web hosting
spain web hosting
suriname
syria web hosting
united kingdom
united kingdom shared web hosting
zambia web hosting