JAVA:
*Java is a high level object oriented programming language developed by sun
microsystems in 1995.
*It is platform independent, which means we can write code once and run it anywhere
using the JVM (java virtual machine).
*Java is widely used for building desktop applications, web applications and
enterprise systems.
High level language:
*We will write our code in high level language we can use alpha.
*High level language is understandable by developer.*High level language cant
understandable by CPU.
*To make understandable we use translator.
Translators:
*Translators will convert one form of code to another form.
*They are 2 types of translators
[Link]
[Link]
[Link]:
*Compiler will convert complete code into binary language that low level process is
called a compiler.
ex: code--->compiler---> 0&$ (binary language)---->CPU
[Link]:
*Interpreter convert the code line by line to binary language (read line by line)
this process is called a interpreter.
Java Process:
*In java process 3 types of stages in Java process
[Link]
[Link]
[Link]
*Coding will be done by developer.
*We should say our java code are file with extension java.
*save the file with same class name.
*compilation will be done by JAVAC.
*JAVAC will convert java code to byte code
*Byte code cant be understand by developer and CPU.
*Byte code is autogenerated code with the file extension class. EX: [Link]
*Byte code file is called a classfile.
*To perform execution are need jdk software (Java development Kit).
*JDK contains JAVAC, JVM, JRE, packages in build program.
*JVM will take byte code as an input and execute line by line and convert into low
level language then given it to CPU.
Editors:
Editors is used to write the code. they are 2 types
[Link] editors
[Link] editors
[Link]:Visual code, eclipse, inteliji, netebeans
[Link] editors: notepad, turbo, edit plus
Introduction:
java invented in the year of 1995 by the green, james gosling was team lead.
*we are using Java8 present version 1.8
Structure of java program:
class ClassName
{
public static void main(string[]args)
{
java structure
}
}
readability:
*Readability means up code written by me it has to be understandable by other
developer.
*To improve readability we go with pascal casing and camelcasing.
Pascal casing:
Pascal casing says that every world first character must be in capital letter.
*Class be in capital letter
*while writing classname don't give space
*Java file name.
crtl+a = all select
crtl+b = Bold
crtl+c = Copy
crtl+d = Duplicate
crtl+f = find
crtl+e = Alignment center side
crtl+g = group & go to
crtl+h = Replace
crtl+i = italic
crtl+j = justify
crtl+k = hyperlink
crtl+l = alignment left side
crtl+m = new side
crtl+n = new document & new page
crtl+o = Open
crtl+p = Print
crtl+q = quit
crtl+r = alignment right side
crtl+s = save
crtl+t = new tab
crtl+u = underline
crtl+v = paste
crtl+w = close the window
crtl+x = cut
crtl+y = rado
crtl+z = undo
crtl+< = previous word
crtl+> = next word
crtl+<- = select previous word
crtl+alt+< = rotate screen left
crtl+alt+> = rotate screen right
crtl+esc = window start menu
crtl+tab = switch b/w open tabs in browser
crtl+shift+tab = will go backward (r-l)
crtl+del = delete next word
crtl+pg dn =next tab
crtl+pg up = previous tab
Variables:
A reusable container for a value.
A variable behaves as if it was the value it contains.
Primitive: Simple value stored directly in memory (stack).
Reference: = Memory address(stack)that points to the (heap).
Primitive vs Reference
int String
double Array
char Object
Boolean