0% found this document useful (0 votes)
3 views16 pages

Java Introduction (M 26)

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views16 pages

Java Introduction (M 26)

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Welcome to Technical

Training for Placement


Preparation Masterclass
by
20
Hrs.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
JAVA
[20 Hrs.]

In-depth training.

Competitive programming.

Hands-on sessions.
This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Skills you will gain…

• Programming Language
• Concepts
• Problem Solving

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Java Java
Part 1 [20 Exception
Handling
Hrs.]
Java
OOP

Java
Arrays
Java
Flow
Control
Java
Introduction

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Part 2 Java I/O
Streams
Java
Set

Java
Map

Java
Java
Queue
Additional
Topics
Java
Java
List
Reader/Write
r
This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
About Java Programming
•Platform independent - We can write Java code in one platform (operating
system) and run on another platform without any modification.
•Object-oriented - Java is an object-oriented language. This helps to make our
Java code more flexible and reusable.
•Speed - Well optimized Java code is nearly as fast as lower-level languages
like C++ and much faster than Python, PHP, etc.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Java Hello World Program

// Your First Program

class HelloWorld {
public static void main(String[] args) {
[Link]("Hello, World!");
}
}

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
How Java "Hello, World!" Program Works?
// Your First Program

In Java, any line starting with // is a comment. Comments are intended for users reading the code to understand
the intent and functionality of the program. It is completely ignored by the Java compiler (an application that
translates Java program to Java bytecode that computer can execute).
class HelloWorld { ... }
In Java, every application begins with a class definition. In the program, HelloWorld is the name of the class.

For now, just remember that every Java application has a class definition, and the name of the class should
match the filename in Java.

public static void main(String[] args) { ... }


This is the main method. Every application in Java must contain the main method. The Java compiler starts
executing the code from the main method.
For now, just remember that the main function is the entry point of your Java application, and it's mandatory in
a Java program.

[Link]("Hello, World!");
The code above is a print statement. It prints the text Hello, World! to standard output (your screen). The text
inside the quotation marks is called String in Java.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
•Every valid Java Application must have a class definition (that matches the

filename).

•The main method must be inside the class definition.

•The compiler executes the codes starting from the main function.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Java JDK, JRE and JVM

What is JVM?
JVM (Java Virtual Machine) is an abstract machine that enables your computer
to run a Java program.
When you run the Java program, Java compiler first compiles your Java code to
bytecode. Then, the JVM translates bytecode into native machine code (set of
instructions that a computer's CPU executes directly).
Java is a platform-independent language. It's because when you write Java
code, it's ultimately written for JVM but not your physical machine (computer).
Since JVM ​executes the Java bytecode which is platform-independent, Java is
platform-independent.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
What is JRE?

JRE (Java Runtime Environment) is a software package that provides Java class
libraries, Java Virtual Machine (JVM), and other components that are required to run
Java applications.

JRE is the superset of JVM.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
What is JDK?

JDK (Java Development Kit) is a software development kit required to develop


applications in Java. When you download JDK, JRE is also downloaded with it.

In addition to JRE, JDK also contains a number of development tools (compilers,


JavaDoc, Java Debugger, etc).

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Relationship between JVM, JRE, and
JDK.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Java Variables and Literals

Java Variables

A variable is a location in memory (storage area) to hold data.


To indicate the storage area, each variable should be given a unique name
(identifier).
Create Variables in Java Note: Java is a statically-
typed language. It means
Here's how we create a variable in Java, that all variables must be
declared before they can be
int speedLimit = 80; used.
Here, speedLimit is a variable of int data type and we have assigned value 80 to it.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
Rules for Naming Variables in Java

Java is case sensitive. Hence, age and AGE are two different variables.

Variables must start with either a letter or an underscore, _ or a dollar,


$ sign.
Variable names cannot start with numbers.

Variable names can't use whitespace.

This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video

You might also like