Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I'm new to coding so how do i name a "class"?

What I have tried:

I dont know where to look for the answer
Posted
Updated 12-Jan-18 23:04pm
Comments
PIEBALDconsult 12-Jan-18 15:04pm    
Look inside. Deep inside.
CodeWraith 12-Jan-18 16:16pm    
I would pick something simple and traditional. How about Frank?

You name your classes to be relevent to whatever it is that you need it to do.

If you are writing something to export data from your database to upload to a third party you probably don't want to name it "XmlWriter" you want to name it something relevant like "VendorExport" or something like that.

You should look into SOLID principles as well. You aught to build your classes in such a way that it has a single responsibility rather than 1 huge monolithic class that does everything under the sun.

Google[^]
 
Share this answer
 
When you create your file where you are making your code and you create the class, it will ask you to name your class.

If you are talking about what you put inside the code it would be something like:
public class Code

(or whatever you want to name it, i just used Code as an example.)
 
Share this answer
 
Quote:
I'm new to coding so how do i name a "class"?

Stop!
Books and tutos are the easy way to learn Java or any other language, they introduce concepts in a timed fashion that ease the understanding, by skipping steps, you will put yourself in deep difficulties, and in the end you will spend more time than if learning correctly at first.

What you try to do is like building a house by starting with the roof.

Millions of people have learned programming before you and millions will follow, methods of teaching are known.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900