• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Java Introduction

by admin

Java programming language is very easy to learn. More than 3 billion devices run Java. Java is used to develop apps for Google’s Android OS, various Desktop Applications, such as media players, antivirus programs, Web Applications, Enterprise Applications (i.e. banking), and many more!

The main Method

the main method must be identical to this signature:

public static void main(String[ ] args)

Here,
public: anyone can access it.
static: method can be run without creating an instance of the class containing the main method.
void: method doesn’t return any value.
main: the name of the method.

System.out.println()

Inside the main() method, we can use the println() method to print a line of text to the screen:

Example:

{
   System.out.println("Hello World!");
}

The println method prints a line of text to the screen.
The System class and its out stream are used to access the println method.

Semicolons in Java

Each code statement must end with a semicolon as shown in the example below:

class MyClass {
  public static void main(String[ ] args) {
    System.out.println("I am learning Java");
  }
}

Filed Under: Java

Some more articles you might also be interested in …

  1. Java Classes and Objects Introduction
  2. Introduction to Exceptions in Java
  3. Java Methods
  4. JAVA Basic Syntax
  5. Arrays in Java
  6. JAVA Installation
  7. How to format Output and Input in Java
  8. keytool error java.io.FileNotFoundException: (Access is denied)
  9. Java Object and Classes
  10. Java – Arrays

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright