Saturday, 14 August 2021

JAVA

Java:

 Java is a OOP originally developed by sun microsystems which was initieted by Jems Gosling and released in 1995. It is owned by oracle and more than 3 billion devices run java. 

Java is a High Level, Object-Oriented, Secure Programming Language, High Performance, Robust, Platform Independent, Multi thread, Portable Programming Language. It own Java Runtime Environment (JRE) and Application Programming Interface (API). 

Use of Java:

Java is used for -

  1. Mobile applications (specially android apps) 
  2. Desktop applications
  3. Web applications
  4. Web server and application servers
  5. Games
  6. Data base connection. 

Advantage of Java:

  1. Java works on different platforms (Ma-windows, Mac, Linux, etc.) 
  2. It is one of the most popular programming language in the world. 
  3. Simple and easy to learn. 
  4. Open source and free. 
  5. It is a fast, secure, powerful programming language. 
  6. Java is a OOP which gives a clear structure to programs and allow code to be reused, lowering development cost. 
  7. Huge community support. 
  8. As Java is close to C and C++, it makes easy for programmers to switch to Java or vice versa. 

Features of Java:

1) Simple. Java is easy to learn and it's syntax is quite simple, clean and easy to understand. The confusing and ambiguous concept of C++ are either left out in Java or they have been re-implimented in a cleaner way. 

     Example- Pointers and operator overloading are not there in Java but we're an important part of C++.

2) Object oriented. In Java, everything is an object which has some data and behaviour. Java can be easily extended as it is based on object model. 

Some basic concept of OOP's are-

(i) Object

(ii) Class

(iii) Inheritance

(iv) Polymorphism

(v) Abstraction

(vi) Encapsulation

3) Robust. Java makes an effort to eliminate error prone codes by emphasizing mainly on compile time error checking and runtime error checking but the main areas which Java improved were memory management and mishandled exceptions by introducing automatic garbage collector and exception handling. 

4) Platform independent. Unlike other programming languages such as C, C++ etc which are compiled into platform specific machines. Java is guaranteed to be write once, run anywhere any language. 

On compilation Java program is compiled into byte code. This byte code is platform independent and can be run on any machine. This byte code formate also provide security. Any machine with Java run time environment can run Java program. 

Java program — [Byte code] - {Linux OS

                                                       Windows OS

                                                        Mac OS}

5) Secure. When it come to security, Java is always to first choice. With Java secure features it enable us to develop virus free, temper free system. Java program always runs in Java runtime environment with almost null interaction with system OS, hence, it is more secure. 

6) Multi threading. Java multi threading feature make it possible to write program that can do many tasks simultaneously. Benefits of multi threading is that is utilizes same memory and other resources to execute multi threads at the same time, like while typing, grammatical errors and checked along. 

7) Architectural neutral. Compiler generates byte codes, which have nothing to do with a particular computer architecture. Hence, a  java program is easy to interpret on any machine. 

8) Portable. Java byte code can be carried to any platform. No implementation dependent features. Everything related to storage in predefined

    Example- size of primitive data types. 

9) High performance. Java is an interpreted language, so it will never be as a compiled language like C or C++. But Java enables high performance with the use of just-in -time compiler. 

10) Distributed. Java is also a distributed language. Programs can be designed to run on computer networks. Java has a special class library for communicating using TCP/IP protocols. Creating network connections is very much easy in Java as compared to C/C++.

Java keywords:

There are 50 keywords in Java i.e.

abstruct

byte

class

do

extends

for

import

long

private

short

switch

throws

volatile

 

 

assert

case

const

double

final

goto

instance of

native

protected

static

synchronized

transient

while

boolean

catch

continue

else

finally

if

int

new

public

strictfp

this

try

break

char

default

enum

float

implement

interface

package

return

super

throw

void

 


Data types in java:

In java there are two types of data types-

  1. Primitive
  2.  Non primitive

1. Primitive data types-

  • Numeric
  • Non numeric

  • Numeric - 
         (i) integer- byte, short, int, long

         (ii) floating point - float, double

  • Non numeric - 
         (i) character, boolean 

2. Non primitive data types-

  • class, array, interface



     

No comments:

Post a Comment

PHOTO ELECTRIC EFFECT - DEFINITION, LAW AND EINSTEIN'S THEORY

 Photo electric effect Consider a negativity charged zinc plate connected to a gold leaf electroscope (Fig. 1). The divergence in the leaves...