Question

what is the purpose of a java class?

what is the purpose of a java class?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The purpose of the java class is to layout a blueprint of the objects we want to consider using in our program since at the core, java is a object oriented language. Once a class is declared, different objects can be created which resemble the class as they will have their own attribute values and methods as we had defined in the class.

For example: If I am working on an app for employees, I have to create a generic definition of what characteristics (referred to as attributes) an employee generally has and what he/she can do (referred to as methods).

So the characteristics of an employee could be his/her Name, age, designation, department, hourly rate, hours worked etc.

The methods could be like calculate the total hours he/she has worked for in the week.

Add a comment
Know the answer?
Add Answer to:
what is the purpose of a java class?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT