$30 off During Our Annual Pro Sale. View Details »

Introduction to Java

Avatar for ARYAN ARYAN
June 08, 2020

Introduction to Java

Let's start with introduction to Java

Avatar for ARYAN

ARYAN

June 08, 2020
Tweet

Other Decks in Programming

Transcript

  1. LEARN TO CODE! ARYAN 3 INTRODUCTION TO Object Oriented Programming(OOP’s)

    It refers to the languages that uses objects in programming. A programme has multiple objects and run them in a set object procedure,Objects interact with each other to achieve a given task. Objects for now can be termed as entities that contain data and certains actions to be performed on it. Popular OOP’s languages are CLASS based that means objects are a copy of class.
  2. LEARN TO CODE! ARYAN 4 INTRODUCTION TO Object Oriented Programming(OOP’s)

    Like for egs DOG. We can say DOG as a class with 4 legs,1 mouth,2 ears and 2 eyes These are its data members. While if a dog have to walk it is a function and it will perform the function on data . Now this is can be termed as the layout of dog. An object(Labrador) would be the real entity to work on and would be the copy of class.
  3. LEARN TO CODE! ARYAN 6 SHORT INTRO TO CLASSES AND

    OBJECTS CLASS it is the entity that binds/wraps up data and functions performed on the data in a single independent entity. • The data of the class is called as member data. • The functions of the class are called as member functions.
  4. LEARN TO CODE! ARYAN 7 SHORT INTRO TO CLASSES AND

    OBJECTS OBJECTS They are the real entities and are the exact copy of the class. It is through objects that we manipulate the data/functions of the class. NOTE:- class also acts as an independent program that logically organises data to generate logical output.
  5. LEARN TO CODE! ARYAN 8 ENCAPSULATION • The binding and

    wrapping up of the data and the functions performed on the data into a single unit called class • It is enabled by the keyword ‘class’.
  6. LEARN TO CODE! ARYAN 9 ABSTRACTION The act of representing

    only essential features without including the background details. Ex: in the movement of dog we only see that the dog is moving and we not focus on the fact what the inner working of its body that he he had done to achieve that task.
  7. LEARN TO CODE! ARYAN 10 Polymorphism Single Entity,Many forms One

    function behaves differently for different objects. Egs:- same paper given to all the students but each student has his/her own answer.
  8. LEARN TO CODE! ARYAN 11 Inheritence When properties of one

    class are taken(inherited) from some another class. The class that gives the property is known as parent/base/super class. The class that takes the property is known as child/derive/sub class. Inheritence is advantageous in reuseability and shows transistive nature.
  9. LEARN TO CODE! ARYAN 12 Compiler vs Interpreter COMPILER ➢

    Executes whole program at once. ➢ Takes less time. ➢ Requires more memory. ➢ Java has 2 compilers javac and jit. INTERPRETER ➢ Executes whole program line by line. ➢ Takes more time ➢ Requires less memory ➢ Java has 1 interpreter JVM.
  10. LEARN TO CODE! ARYAN 14 Java Compilers. Java has 2

    compiler javac and jit. javac compiles the whole source code to the byte code. JIT (Just in Time) compiles the most frequently used commands in the code only once and hence improving the effeciency of program. After javac and jit have compiled the code the code can be sent accross any device and then through JVM could be executed on that device.
  11. LEARN TO CODE! ARYAN 15 The Java Byte Code It

    is the machine independent code. It can be termed as the machine instructions for JVM(Java Virtual Machine). It can be simplified as a binary code consisting of only 0/1 which is converted by JVM from the source code that we write and thus making it readable by every digital device in the world. The device just needs to be JVM-compatible to be able to run the code.
  12. LEARN TO CODE! ARYAN 16 Java Virtual Machine The programs

    written in java are first compiled into a byte code and then interpreted by a speacial Java Interpreter unique for each platform, the interpeter is known as Java Virtual Machine.
  13. LEARN TO CODE! ARYAN 17 CHARACTERSTICS OF JAVA 1.Platform independent

    2.Case sensitive 3.Object Oriented Language 4.Multi-threading 5.Security 6.typed-language 7.WORA(write once run anywhere)
  14. LEARN TO CODE! ARYAN 18 CHARACTERSTICS OF JAVA Multi-Threading:- program

    is parititoned into modules which reduces the complexity of the program and creates well-defined boundry for the program. Secure:- there is no direct access to the ram in between lies the JVM. Typed-language-each variable is specified with the type of data it will hold.
  15. LEARN TO CODE! ARYAN 19 Types of Java Program’s 1.Java

    Applets:- these are designed to be run on internet i.e over the web. 2.Java Standalone Apllications:- these are designed to work as a seperate program to be able to be executed on a machine.
  16. LEARN TO CODE! ARYAN 21 TOKENS ->Tokens are the smallest

    indivdual unit of a program. ->They are of 5 type 1.Keyword 2.Identifier 3.Literals 4.Punctuators 5.Operators
  17. LEARN TO CODE! ARYAN 22 KEYWORDS These are words that

    convey speacial meaning to the compiler There are 57 keywords which includes Reserved Words – const and goto Constants – true,false,null
  18. LEARN TO CODE! ARYAN 23 IDENTIFIERS and LITERALS These are

    named memory location used to store temprory constants(literals) The fixed data values are called as literals.
  19. LEARN TO CODE! ARYAN 24 Naming Convention for Identifiers 1.Should

    start with an alphabet 2.Should not be a reserved word/keyword. 3.Only ‘_’ and ‘$’ are allowed. 4.Can have numbers. Egs:- Valid: hey,hey_12,hey123 Invalid: 12hey,_hey,$Home
  20. LEARN TO CODE! ARYAN 25 Data Type’s in Java ->

    The type of value a variable will hold is known as data type. ->are the means to identify the type of data and associated operations of handling it. They are of 2 types:- 1.Primitive Data Types 2.Non-Primitive Data Types
  21. LEARN TO CODE! ARYAN 26 PRIMITIVE DATA TYPES ->fundamental data

    types offered by java. ->these are one of the basic building program in java.
  22. LEARN TO CODE! ARYAN 27 NUMERIC Integer:- byte,short,int,long numbers without

    decimal point. Egs:12,56,1763 Floating point:-float,double numbers with decimal point. Egs:- 12.5 , 1029.0001
  23. LEARN TO CODE! ARYAN 28 NON-NUMERIC Character:- alphanumeric single character.

    Egs:- ‘a’, ‘@’ , ‘3’. Boolean:- true/false (conditional literals).
  24. LEARN TO CODE! ARYAN 29 NON-PRIMITIVE DATA TYPES ->They are

    user defined data types. ->They are also called as reference data types as they store address of the value given to them. ->These are of 3 types 1.Array 2.Class 3.Interface
  25. LEARN TO CODE! ARYAN 30 EXTRA MATERIAL Rvalue:- data value,

    stored at some location in the memory. Egs:- primitive data types. Lvalue:- location value, address in memory where data is stored. Egs:- reference data types.
  26. LEARN TO CODE! ARYAN 31 CHARACTER SET OF JAVA ->

    It is the set of valid characters that java can recognise. ->Java uses the Unicode character code. ->There are 2 character sets that Java can recognise. 1.Ascaii code 2.Unicode
  27. LEARN TO CODE! ARYAN 32 ASCAII CODE AND UNICODE ASCAII

    CODE 1.contains characters from 0-255. 2.7 bit coding system UNICODE 1.contains characters from 0-65535 2.16 bit coding (hexadecimal system) 3.first 0-255 characters are same as ascai code.