Why should we learn programming languages?
computer can understand binary values only.
computer
can’t understand high level languages i.e., C++, Java... etc.
by using
programming languages, we are writing code in human understandable language
(English.) and then converting to machine understandable language that is
binary values using compiler.
Note: in Java we are converting Java code (source code) into machine understandable
language by using compiler, interpreter and JVM.
What is Java
Java is
programming language by using Java we can develop standalone (desktop app), web
applications…etc.!
How to develop Java Application
before work with Java first we should install Java software, download JDK and install Java in our computer.
2)compile Java code by javac command
3)execute Java program by using java command.
How to Run/Execute Java Program?
save file with .java extension in note pad
Ex:
Human.java
open
command prompt in file location compile Java program by using this command
E:\>javac Human.java
.class file
will be generated in that file location.
after
compilation run Java program by using Java command.
E:\>java Human
here we
use two commands to run and execute Java program.
1)javac
2)java
Javac (compiler) converts our Java code to byte code and executed byte code run by JVM in JRE by calling java command.
whenever we are compile and run our Java application we may get errors.
this errors are divided into 2 types.
1)Compile Time Error
2)Runtime Error
Compile time Error:
whenever we are compiling Java program using javac command entire source code compile at a time it verifies only syntax and misspelling of identifier and keywords.
Runtime
Error:
after
compilation successfully there may be chance of getting run time errors/ bugs. before hosting our application, we should find and handle these bugs.
this error may occur when user enter invalid inputs
example:
divide number by zero, null values.
and file not found errors or logical errors, input/output errors …etc.
No comments:
Post a Comment