JAVA - Introduction

Java is a class-based , simple , object oriented programming language .It is general purpose programming language used to develop applications can independent of any platform and can write and run anywhere . 

It works on many platforms like windows , Linux , Mac , Raspberry  pi , etc.

History of java : 

Java is a world-wide used programming language . Initially java was developed by scientists James Gosling by Sun Microsystems in 1995 .

Later java was handover to Oracle and now java has been handled by Oracle . 

Applications of java :

  • Mobile Applications
  • Desktop applications
  • Web servers
  • Application servers
  • Games
  • Database


Features Of JAVA :-


1. Class : Class is a special block of code which is executed using object .Class has its data members and member functions . Class keyword is used to declare a class .

2. Object : Object is a instance of class . It is an sub part of class .


In the above example , there are given laptop with brands 

Laptop is a main block i.e. class and its brands are its different objects It means object is an instance of class .

Object has two properties state and behaviour 

3Data Abstraction : Data abstraction points to useful and essential information or data . The visibility of useful data and hiding un-useful data is called as data abstraction .
For example , we sends messages on email , watsapp , etc . We can able to see only message not process behind it . 

4. Polymorphism : The meaning of poly is many and meaning of morphism is forms .It is an ability to take more than many forms . We can create many forms of one thing this process is called as polymorphism .

5. Message Passing : It means the communication between objects , data or classes .

6. Encapsulations : The providing security to data like wrapper class called as encapsulation . 
For example , medicine capsule is one type of wrapper , it consists of small small particles that means it provides security to those small particles inside it .

7. Inheritance : The child class or derived class derives/inherits properties from parent class or base class is called as inheritance .
For example , We takes some features from our parents like color body features etc , this property is called as inheritance .

8. Data binding : The holding of data together is called as data binding .


Data types in java :

Data types are used in every programming language .It is an essential part of any program .

Data types are used to show which type of data you are using in a program .

 There are two types of data types in java : 

Note : Everything in java is an string , which means if you have to store integers or floats so you have to convert in these data types .

1.Primitive data types :

Data types which are pre-defined by an system called as primitive data types .

i) int :

    • int data type is an 32-bit signed integer .
    • The numbers or integers are of int data type
    • It has rang of -2,147,483,648... to 2,147,483,847
    • The default value is 0
    • Example : int t=2000

ii) char :

    • char is an single 16-bit unicode character
    • Alphabets , letters are of char data type
    • Minimum value is '\u0000'(or 0)
    • Maximum value is '\uffff'(or 65,535)
    • Exanple : char t='tprograming

iii) float :

    • Float is an single-precision 32-bit IEEE 754 floating point
    • single decimal points are stored here
    • Minimum value is 0.0f
    • Example : float t=4.3

iv) double :

    • It is an double-pricision 64-bit IEEE 754 floating point
    • Is is used to store long decimal points
    • Default value is 0.0d
    • Example : double t=2345.098

v) byte :

    •  Byte is an 8-bit signed integer
    • It has range from -128 to 127
    • Default value is 0
    • Byte is four times smaller than int 
    • Example : byte t=100