DEV Community

Edison Ade
Edison Ade

Posted on

3 1

I started learning Java

I downloaded Java here:

And then i am using Intellij IDE from Jetbrains.
Download here

I wrote my first Java program 2 days ago. I am doing this with the #100DaysOfCode on Twitter. To track my progress.

What i have learnt so far.

  • Every Java program must have at least one function.
  • The functions don’t exist on their own. It must always belong to a class.
  • A class is a container for related functions.
  • Every Java program must have at least one Class that holds the main function
  • Then we need Access modifiers in Java.

What are access modifiers?
They help set boundaries to the scope of a class, constructor , variable, or method.

For my first Java program. I will only be interested in the "Public" access modifier.

package com.codewitedison;

public class Main {

    public static void main(String[] args) {
System.out.println("Welcome to my first Java Program);
    }
}

Enter fullscreen mode Exit fullscreen mode

Intellij makes it really easy. So it came with the Java boilerplate that set the public class main and the public static void main lines. I only added the System.out.println and print message. System.out is a way to print results to the terminal.

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Jetbrains image

Is Your CI/CD Server a Prime Target for Attack?

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. It makes sense—CI/CD servers have access to source code, a highly valuable asset. Is yours secure? Check out nine practical tips to protect your CI/CD.

Learn more

👋 Kindness is contagious

Explore this insightful post in the vibrant DEV Community. Developers from all walks of life are invited to contribute and elevate our shared know-how.

A simple "thank you" could lift spirits—leave your kudos in the comments!

On DEV, passing on wisdom paves our way and unites us. Enjoyed this piece? A brief note of thanks to the writer goes a long way.

Okay