L1 1. Introduction To Java PDF
L1 1. Introduction To Java PDF
1 INTRODUCTION TO JAVA
1. Platform Independent
It is one of the best features of Java as it is the first programming language
that is not depends on Operating System. In other words, WORA- Write
once Run anywhere. Java code can be executed anywhere on any system.
2. Simple
Java is simple to learn and use. In Java, it is easy to write and debug
programs because Java does not use pointers. Java syntax is based on C++
(so easier for programmers to learn it after C++).
Java has removed many complicated and rarely-used features, for example,
explicit pointers, operator overloading, etc. If a programmer understands
the basic concepts of Oops, it becomes easier for him/her to learn Java
Programming.
3. Secure
Java is best known for its security. With Java, we can develop virus-free
systems. In today’s world everybody needs safety and security. Because of
to the threat of hackers, people feel unsafe while using application over the
Internet. To overcome such fears, Java provides safety and security
features. Java provides these securities by default. Some security can also
4. Portable
Java is portable because it facilitates you to carry the Java byte code to any
platform. It doesn't require any implementation.
5. Robust
Robust simply means strong. Java is robust because:
a) It uses strong memory management.
b) There is a lack of pointers that avoids security problems.
There is automatic garbage collection in java which runs on the Java
Virtual Machine to get rid of objects which are not being used by a Java
application anymore.
There are exception handling and the type checking mechanism in Java.
All these points make Java robust.
6. Multithreading
Java's multithreaded feature it is possible to write programs that can
perform many tasks simultaneously. This design feature allows the
developers to construct interactive applications that can run smoothly.
Threads are important for multi-media, Web applications, etc.
7. Distributed
Java is distributed because it facilitates users to create distributed
applications in Java. RMI and EJB are used for creating distributed
applications. This feature of Java makes us able to access files by calling
the methods from any machine on the internet.
8. Architecture-neutral
Java compiler generates an architecture-neutral object file format, which
makes the compiled code executable on many processors, with the
presence of Java runtime system.
9. High Performance
10.Dynamic
Java is a dynamic language. It supports dynamic loading of classes. It
means classes are loaded on demand. It also supports functions from its
native languages, i.e., C and C++.
Java supports dynamic compilation and automatic memory management
(garbage collection).
11.Object Oriented
In Java, everything is an Object and Classes. Java can be easily extended
since it is based on the Object model.
Explanation-
Class: This line uses the keyword class to declare that a new class is
being defined.
public: It is an Access Modifier, which defines who can access this
Method. Public means that this Method will be accessible by any Class
Welcome: It is an identifier that is the name of the class. The entire class
definition, including all of its members, will be between the opening
curly brace: {and the closing curly brace}.
static: It is a keyword that identifies the class-related thing. It means the
given Method or variable is not instance-related but Class related. It can
be accessed without creating the instance of a Class.
void: It is used to define the Return Type of the Method. It defines what
the method can return. Void means the Method will not return any value.
main: It is the name of the Method. This Method name is searched by
JVM as a starting point for an application with a particular signature
only.
String args[] / String… args: It is the parameter to the main method.
The argument name could be anything.
System.out.println(): It is used to print statement. Here, System is a
class, out is the object of PrintStream class, println() is the method of
PrintStream class.