Showing Page:
1/3
INTRODUCTION OF JAVA PROGRAMING LANGUAGE
Java is an Object Oriented programming language developed by Sum
Microsystems of USA in 1991.
It was originally called Oak by James Goslin.(one of the inventors of
Java!)
Java is one of the most popular programming languages because it is
used in various tech fields like app development, web development,
client-server applications, etc.
JAVA = Purely object oriented programming language.
How JAVA Works?
Java is Compiled into the bytecode and then it is interpreted to machine
code.
Java Installation.
Step 1: Downloading JDK
Go to Google & type “Install JDK” ===> Install Java JDK
Go to Google & type “Install IntelliJ Idea”===>Install JAVA IDE
JDK --> JAVA Development Kit = Collection of tools used for developing
and running Java programs.
JRE --> JAVA Runtime Environment = Helps in executing programs
developed in JAVA
Basic Structure of a Java Program:
Showing Page:
2/3
Working of the "Hello World" program shown above :
1. package com.company :
Packages are used to group the related classes.
The "Package" keyword is used to create packages in Java.
Here, com.company is the name of our package.
2. public class Main :
In Java, every program must contain a class.
The filename and name of the class should be the same.
Here, we've created a class named "Main".
It is the entry point to the application.
3. public static void main(String[]args){..} :
This is the main() method of our Java program.
Every Java program must contain the main() method.
4. System.out.println("Hello World"):
The above code is used to display the output on the screen.
Anything passed inside the inverted commas is printed on the screen
as plain text.
Naming Conventions:
For classes, we use Pascal Convention. The first and Subsequent
characters from a word are capital letters (uppercase).
Example: Main, MyScanner, MyEmployee, CodeWithHarry
For functions and variables, we use camelCaseConvention. Here the
first character is lowercase, and the subsequent characters are
uppercase like myScanner, myMarks, CodeWithHarry
Showing Page:
3/3

Unformatted Attachment Preview

Name: Description: ...
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4