You are on page 1of 2

In JAVA every application begins with a class name and that class name must match

with the file name.


Every line of code that runs in java should be written inside that class.
A class should always start with an uppercase letter. e.g class Hello
Java is case sensitive so :
Myclass and myclass are different with different meaning
The main() method is required and we shall see it in every prog#ram.

What is static keyword?


We use it so that compiler doesnt need to create the object class again.

Why is java platform independent?

because java compilation creates a bytecode that could be run independent of


platform.

JAR = Java Archives


CSV = Comma Seperated Values

JDK = Java Development Kit is a software development environment which is used to


develop java applications and applets. It physically exists and contains JRE + Dev
tools
JDK contains a private JVM (JAVA Virtual Machine) and a few other resources such as
an interpreter/loader(JAVA), compiler(JAVAC), archiver(jar), a documentation
generator(java doc), etc.
JRE = Java Runtime Environment or JRTE is a set of software tools which are used
for developing java applications.It is used to provide the runtime environment. It
is the implementation of
JVM and it physically exists.
It contains a set of libraries and other files that JVM uses at runtime.
JVM = Java Virtual Machine is an abstract machine because it doesnt physically
exist. It is a specification which provides a runtime environment in which Java
bytecode can be executed. It
can also run those programs that are written in other languages and compile it to
java bytecode.

Java performs the following main tasks:


->It loads the code
->It verifies the code.
->It executes code.
->It provides runtime environment for bytecode.

JIT - Just in time Compiler is used to improve the performance. It compiles part of
bytecode that have similar functionalities at the same time, and hence reduces the
amount of time needed
for the compilation. Here the term compiler refers to a translator from the
instruction set of JVM to the instruction set of specific CPU.

Variable - It is a named memory location


Identifiers- It is a name assigned.

Rules for naming variables:


-> Java is case sensitive, hence "age" and "AGE" are different.
-> Variable must start with a letter or underscore or dollar sign.
-> Variable names cannot have whitespaces.
-> There are four types of variables:

1) Static 2) Instance 3) Local 4) Parameter


Static variables are also called class variables.

Typecasting:

Narrowing(Explicit-manually converted-bigger datatype to smaller datatype) and


Widening(Implicit- automatically converted-smaller datatype to bigger datatype)

Naming conventions in Java:

Lowercase : helloworld
Uppercase : HELLOWORLD
Camel case(UpperCamelCase) : HelloWorld
Mixed case(lowerCamelCase) : helloWorld

Standard JAVA Naming Conventions:

Packages: lowercase
Classes: CamelCase
Interfaces: CamelCase
Methods: mixedCase
Variables: mixedCase
Constants: UPPERCASE

Operators in Java:
->Arithmetic

*, /, %, +, -

->Unary

-, +,
++:
post increment (i++) : compute and then increase by 1, pre increment (++i) :
increase by 1 and then compute
--
->Assignment:
variable = value
+=,-+,*=,/=,%=

a+=b == a= a+b

->Logical

You might also like