Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
18 views

Features of Java

Java is a compiled and interpreted language that is platform independent, portable, object-oriented, robust, secure, distributed, and multithreaded. It uses bytecode that is executed by the Java Virtual Machine (JVM) making programs architecture neutral. Java has primitive datatypes including integers, floating points, characters, and booleans and supports variables that can be instance, class, or local depending on their scope.

Uploaded by

Roshan Nair
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Features of Java

Java is a compiled and interpreted language that is platform independent, portable, object-oriented, robust, secure, distributed, and multithreaded. It uses bytecode that is executed by the Java Virtual Machine (JVM) making programs architecture neutral. Java has primitive datatypes including integers, floating points, characters, and booleans and supports variables that can be instance, class, or local depending on their scope.

Uploaded by

Roshan Nair
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

FEATURES OF JAVA:

1. COMPILED AND INTERPRETER:

 Java compiler has both this approach.  Java compiler translates source code into byte code instruction.  Java interpreter generate machine code executed by this machine i.e. operating system running the java program.
2. PLATFORMINDEPENDENT & PORTABLE:

 Java program can be easily moved from one computer system to another.  Changes and upgrades in OS will not affect any of the java program, therefore it is called platform independent.  Java ensuresportability: Java compiler generate byte code instruction that can be implemented on any machine.
3. OBJECT ORIENTED:

 Almost everything in java is object oriented.  Java comes with extensive set of classes arranged in packages. 4. ROBUST AND SECURE:  It is design at garbage collector language.  Relieving the programmer virtually all memory management problem.  It also incorporates concept of exception handling which captures error and eliminates any risk of crashing the system

5. DISTRIBUTED:

 Java is design as a distributed language for creating applications on network.  It has the ability to share both data and programs.  Java application access remote object easily as they can do in a local system.
6. MULTITHREADED:

 Multithreaded means handling multiple tasks simultaneously.  Java supports multithreaded programs.  This means we need not wait for the completion of one task to begin the other.
7. DYNAMIC AND EXTENSIBLE:

 It is dynamic language capable of dynamically linking in a new class library methods and objects.

CONCEPT OF BYTE CODE:  Byte code is highly optimized set of instruction.  Design to be executed by java run time system called as jvm (java virtual machine).  Translating a java program into a byte code makes it much easier to do a programming in a wide variety of environment.  Only jvm needs to be implemented for each platform.  Although details of jvm will differ from platform to platform all understand same byte code.

CONCEPT OF JVM:  All language compilers translate source code into machine code for a specific computer.  Java compiler does the same thing to achieve architecture neutrality.  Java compiler produce intermediate code known as byte code for a machine that does not exist.  This machine is called as jvm and it exist only inside computer memory.  Virtual machine code is not a machine specific.

 The machine specific code is generated by java interpreter. By intermediatory between virtual machine and real machine.

SIMPLE JAVA PROGRAM:

1. public :  It is keyword for an access specifier that declares the main method as an unprotected, therefore, making it accessible for all other class. 2. static :  It declares this method as one that belongs to entire class and not a part of any object of the class.  The main must always be declare as static since interpreter use this method before any object created. 3. void main() :  It is a type modifier void states that main method does not return any value. 4. String args[] :  It declares a parameter named args[]which contain array of class type string. 5. System.out.println :  The println method is a member of output objectwhich is a static data member of system class.

NOTE: EVERY JAVA STATEMENT MUST END WITH SEMICOLON (;).

DATATYPES IN JAVA: Java defines 8 primitive types of data and they are: Byte, short, int, long, char, float, double, Boolean. This can be put into 4 groups: 1. INTEGERS:  byte, short, int, long which are whole value sign numbers, 2. FLOATING POINT:  float and double which represent numbers with fraction precision. 3. CHARACTER:  It includes char which represent symbol in a character set like letters and numbers. 4. BOOLEAN:  It includes Boolean which is a special type for representing true or false value.

COMMAND LINE ARGUMENT:

 There may be occasion when we may like the program to act in a particular way dependent on input provided at the time of execution.  This is achieved by command line argument.  These are the parameters that are supplied at the time of program execution.

VARIABLES: Variables are storage locations; declaration of variables does 3 things:  It tells the compiler what the variable name is.  It specifies what type of data the variable will hold.  The place of variable declaration decides scope of the variable. Scope of the variables: The area of program where the variable is accessible is called its scope. Java variables accurately classified in 3 kinds: 1. INSTANCE VARIABLE:  They are classified when the objects are instantiated; therefore they are associated with objects. 2. CLASS VARIABLE:  They are global to class and belong to entire set of object that class created.  Only one memory location is created for each class. 3. LOCAL VARIABLE:  Variable declared and used inside the method is called local variable.  They are not accessible outside the method definition.

You might also like