JAVA
Java is basically an coffee breed ,it was basically developed by sun microsystems in 1951. Vinod
khosla was the founder of java and he left it after two years.java was developed by james gosling.
The basic principle of java is WORA (write once run anywhere)
Java library is a collection of pre defined classes java has basically many flavours such as
1.)JAVA SE (Standard edition)[Core JAVA]
2.)JAVA EE (Enterprise edition)[Advanced JAVA]
3.)JAVA ME(Micro edition)
Versions of java are:-
The latest version of java is JAVA SE 11
Release date Highlights
Release
Java SE 11[349] 2018-09-25 Initial release
Java SE 11.0.1[350] 2018-10-16 Security & bug fixes
Java SE 11.0.2[351] 2019-01-15 Security & bug fixes
FEATURES of JAVA are:-
Example of multi threading is a game in which 2 codes are running simultaneously
Garbage collector:-it is a special prog.and reduces the space consumption of unused data
COMPILE AND RUN:-
Java compiler compiles the .java file into .class file which is not understood by the O.S., so
java uses a JVM (as an interpreter) which converts the .class file into a file which is easily
understood by the O.S.
Difference b\w a compiler and interpreter
Compiler:-it makes a file and stores the whole translation into it and then hand over it to
the O.S.
(JVM)Interpreter:-it converts the code line by line and handle it over to the O.S.it is
platform dependent
Installation of JAVA:-
It consist of 2 folders i.e, JDK & JRE in which we have to specify the installation path
There are 4 access specifiers in java language i.e.
1.)public
2.)private
3.)protected
4.)default
HelloWorld- is a camel case in which we have to write the names without
space and Hello World is a class.
Public static void main(string[] args)-
Public-access specifier hone ka matlab h ki ye iske prog ke scope k bahar call ho sakta h
Static-static is a keyword that is used in a class so that we did not want to make the object
file of it but if we are not using the static keyword than we have to make the object file.
Void-it is a type of return variable which returns nothing.
Main-is a function
String[] args- is an array in which the arguments are stored and these are known as
strings
System.out.println(“HelloWorld”);
System is a class as it is starting from the capital letter as it is followed by a dot which means
it is calling a static function.
Out is reffered as a reference variable which is pointing towards a object but we consider it
here as a object which is followed by a dot that means the out is also a class of any function
and we are calling the print screen function, i.e. println
The words written within the parenthesis is the output which we are going to see on the
screen.
Keywords:-
There are a few keywords that are used in java language i.e,
What is a Data Type?
Types Of Data Types:-
Primitive Type Data Type:-
These are the data types that are already stored in the libraries that
are used in the java language and these are found in the form of
keywords. These are also known as pre-defined datatypes
Example:-
User Defined Data Type:-
These are the data types that are defined by the user itself.
Types Of Primitive Data Types and their Size:-
TYPE CONVERSION