Creating a Class

Creating a class in Java

Basic Java Class structure

In order to start  coding in your program , you must have to create a class.

public class Dog
{



}
  • Here we have created a class called “Dog” and the class is public (access modifier)
  • Every class should have opening and closing curly braces and
  • Every word in a class name should start with capital letter like “D” in Dog. For example “TestApplication” , “NetworkSwitch”.

What goes inside class?

  • A class contains variables
  • It contains one or more methods.

Now we have created a class and  we have to insert methods  inside the class. So let’s move on to the next lesson

 

 

 

5 thoughts on “Creating a Class

  1. Wow, wonderful weblog layout! How long have you ever been running a blog for? you made running a blog look easy. The entire look of your site is magnificent, as smartly as the content material!

  2. That is very interesting, You’re an excessively skilled blogger. I have joined your rss feed and look ahead to seeking more of your wonderful post. Also, I’ve shared your website in my social networks!

Leave a Reply

Your email address will not be published. Required fields are marked *