Types of Java classes

Fetching Comments ...
Types of Java classes

JAVA classes are of two types :

  1. Built in Classes
  2. User Defined Classes

Built in Classes :

Built in JAVA Classes are Predefined Classes. Predefined Class means those Classes which are not created by us. (In simple words we can say JAVA Virtual Machine provide some classes with features) that classes are called as Predefined JAVA Classes.

for example :

  • String
  • System
  • InputStream
  • Reader

there are thousands of classes are available in JAVA World. Each and every class have its own property.

for Example:

String class is used to create normal Strings. if you don’t know what is string, then don’t need to worry about it I will explain this in Strings chapter. for now “hello world” everything written in double quotes ("") is called as String. if you have some basic knowledge about C or C++ language then you will understand what is String. And in String class it have some other features like :

  • if you want to convert “Hello World” to “HELLO WORLD” then you don’t need to type by your self, you can use String class’s feature to make whole sentence in Uppercase.
  • you can break “Hello World” into “hello” “world”.

So this is just basic knowledge about what are Built in classes, and why we need built in classes.

Why we need Built in classes in JAVA :

We need built in Classes in every Programming language, Programming language without Classes are incomplete. Below are cases when you need Built in classes to complete out task.

  • To create strings we need to use String Class.
  • To print something we need System class.
  • To read something from user’s input we need Reader class.
  • To create file or folder using JAVA we need File class.

and so on. So this is real definition of Built in classes in every Programming language.

User Defined Classes :

Those classes which are created by us. Or those classes which we created to reuse in future, is called as User defined classes.

for example : Hello,Abc,Demo etc. these classes are not defined by JAVA itself. we made these classes to use in future or combine everything in a single class.

Let see how to create a simple class :

class Hello{


this is syntax of creating class in JAVA. I will explain in detail about creating class in JAVA.

Share This:

Featured Posts

post preview
post preview
post preview
post preview
post preview


Related Posts

Get The Best Of All Hands Delivered To Your Inbox

Subscribe to our newsletter and stay updated.