DEV Community

Cover image for core java-Basics
Sahithi Puppala
Sahithi Puppala

Posted on • Edited on

2

core java-Basics

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 ....................................................

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more