Click here to Skip to main content
13,593,166 members
Rate this:
 
Please Sign up or sign in to vote.
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 12-Jan-18 8:27am
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?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.)
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180618.1 | Last Updated 13 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100