Professional Documents
Culture Documents
Day 1
Day 1
One major advantage of developing software with Java is its portability. Once you
have written code for a Java program on a notebook computer,
it is very easy to move the code to a mobile device
why java?
Java has significant advantages over other languages and environments that make it
suitable for just about any programming task.
The advantages of Java are as follows: Java is easy to learn. Java was designed to
be easy to use and is therefore easy to write,
compile, debug, and learn than other programming languages.
Application of java?
Systax of java?
The syntax of Java refers to the set of rules defining how a Java program is
written and interpreted.
The syntax is mostly derived from C and C++. Unlike in C++, in Java there are no
global functions or variables, but there are data members
which are also regarded as global variables. All code belongs to classes and all
values are objects. The only exception is the primitive types
, which are not represented by a class instance for performance reasons (though can
be automatically converted to objects and vice versa via autoboxing)
. Some features like operator overloading or unsigned integer types are omitted to
simplify the language and to avoid possible programming mistakes.
Keywords in java ?
The Java syntax has been gradually extended in the course of numerous major JDK
releases, and now supports capabilities such as generic programming and
function literals (called lambda expressions in Java). Since 2017, a new JDK
version is released twice a year, with each release bringing incremental
improvements to the language.
continue
default
else
enum
extends
float
for
goto
import
instance
of
int
native
Data types in java?
boolean data type, byte data type, char data type, short data type, int data type,
long data type, float data type, double data type
Java’s main method is composed of six terms — three reserved words, the main method
name, a reference type and a variable name:
ans: The keyword is used to create a class EVERY LINE OF CODE THAT RUNS IN
JAVA MUST BE INSIDE A CLASS. A class should always start with in uppercase first
letter,
and the name of java file must matchthe class name.
In generalm,class declaration can include these components,in order:
1.Modifiers such as public,private,and a number of others that you
will encounter later.
2.The class name,with the initial letter capitalized by convention.
3.The name of the classes parent(superclass),if any,proceed by the
keyword extends.
4.A comma-separated list of interfaces implemented by the class
proceed by ketword implements.
5.The class body,surrounding by brases{}.