DEV Community

Edison Ade
Edison Ade

Posted on

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.

Top comments (0)