core java-Basics

Sahithi Puppala - Jun 28 - - Dev Community

Day 1

  • i am also beginner , lets learn together🤓

BASIC JAVA PROGRAMMING:

         "in java if you want write any code in java we need to take the hype of CLASS or INTERFACE or ENUM." 


                  1.Class
                  2.Interface
                  3.Enum
Enter fullscreen mode Exit fullscreen mode

First we learn each one syntax's !!!

Wait............................

Q)WHAT IS SYNTAX?
A: Syntax means Some set of rules which we need to follow whenever we are writing the code if we are not following the syntax we will be getting an error.

CLASS:

---->Syntax of Class:
Class
{
------;
------;
}

Example:
Public Class ClassA
{
-----;
-----;
}

INTERFACE:

---->Syntax of Interface:
< Access Modifier > Interface
{
-------;
-------;
}

Example:
Public Interface ClassA
{
-----;
-----;
}

ENUM:

---->Syntax of Enum:
Enum
{
-------;
-------;
}

Example:
Public enum ClassA
{
-----;
-----;
}

i think you all are one doubt in your mind!!!

What is Access Modifiers?

Access Modifiers:

             Access Modifiers Provide Access Restrictions Which Will enhance the data Security.in java We are having '4' access Modifiers.

               1.Public
               2.Private
               3.Protected
               4.Package-Private(default)   
Enter fullscreen mode Exit fullscreen mode

Note: We can use only '2' access Modifiers for a java Class, they are Public & Package-Private(Default).

waiting for Day-2 ....................................................

. . .