Introduction to java programming
what is java?
What is a computer?
A computer is an electronic device for storing and processing huge amounts of information.
What is a computer program?
A computer program is a set of instructions for a computer to perform a specific task. A computer cannot do anything by itself, if it wants to do something, it must get clear instructions, the instructions given in this way are called programs(Wikipedia)
What is a programming language?
An artificial language used to control a computer is called computer programming
language.Every programming language is defined by the same set of grammar rules as the languages humans use for communication.Thousands of programming languages exist today(Wikipedia)
Examples of popular programming languages include Python, Java, C++, JavaScript, and Ruby. Each language has its own strengths and weaknesses and is suited for different types of projects.The choice of programming language depends on the specific requirements of a project, including the platform being used, the intended audience, and the desired outcome. Programming languages continue to evolve and change over time, with new languages being developed and older ones being updated to meet changing needs. Java is one of the most popular programming languages.
What is the syntax of a programming language?
In computer science, the syntax of a computer language is the rules that define the combinations of symbols that are considered to be correctly structured statements or expressions in that language(Wikipedia).
JVM and Importance of JVM:
A virtual machine is a software in computer science. Here, the role of a virtual machine is to create an environment to run a program.In computing, a virtual machine (VM) is the virtualization or emulation of a computer system.
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode
How to learn java?
In java programming, first you learn syntax of the java.
Every computer programming language have its own syntax
Then study different basic concepts in java.
Importantly understand the oops concept very well.
How to use for loop how to use while loop
How to check for the condition and how objects work. Learning Java will be
straightforward for you if you understand this.
Java program syntax
class ClassName----->class declaration
{ ------>start of program block
// ------> single line comments
public static void main(String args[]) ------>entry method
{
System.out.println("This is simple java program"); ------>printing method
}
} -----> end of program block
Basic Terminology
software required
• JDK consists of compiler(JRE+JVM)
• JDK Java Development Kit
• JRE Java RunTime Environment
• JVM Java Virtual Machine
What is a JVM?
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode.
In computing, a virtual machine (VM) is the virtualization or emulation of a computer system.Virtualization or emulation refers to the ability of a computer program on an electronic device to imitate another program or device
(Wikipedia).What is JDK?
JDK can be considered as a kit inside which resides the JRE along with developing tools within it. For each execution of your program, the JDK and JRE come into use, and they go within the JVM to run the Java source code.
Before writing Java program set classpath in your system
Java program extension is (.java)
After compilation .class file is generated or (byte code)
This byte code is enter in JVM output is produced
The JVM is depended the operating system
Every operating system has its on JVM but the same output is produced
Java is write one run anywhere(WORE) is called platform in-depended
what is JDK?
Object type Q&A
1. The first version of Java was actually named Oak
2. A single line statement in Java ends with semicolon
3. The execution of Java application begin at main method
Hello world program
java hello world program
class Welcome{
public static void main(String arg[]){
System.out.println("Hello World");
}
}
The beginning of Java program processing always starts in the main method
Save the name of the class with the main method.
👍
ReplyDelete