SlideShare a Scribd company logo
1 of 34
Introduction to Java


Pre-assessment Questions
   1.     ______ is the feature of OOPS that implies that the non-essential details of
          an object are hidden from the user and an access is provided to its essential
          details.
           a. Inheritance
           b. Abstraction
           c. Polymorphism
           d. Encapsulation

   2.     What is the relationship between objects of a superclass and subclass known
          as?.
          a. Kind-Of
           b. Abstraction
          c. Part-Of
          d. Has-A


  ©NIIT                     Java Fundamentals                Lesson 2A/Slide 1 of 34
Introduction to Java


Pre-assessment Questions (Contd.)
   1.     Identify the feature of OOPS that means ignoring the non-essential details of
          an object and concentrating on its essential features?
          •    Inheritance
          •    Encapsulation
          •    Abstraction
          •    Polymorphism

   •      What is the type of inheritance in which a subclass is derived from more than
          one super class known as?
          a.   Single Inheritance
          b.   Multiple Inheritance
          c.   Multilevel Inheritance
          d.   Hybrid Inheritance




  ©NIIT                     Java Fundamentals               Lesson 2A/Slide 2 of 34
Introduction to Java


Pre-assessment Questions (Contd.)
   5.     Identify the type of relationship shared by the Gear and Automobile class in
          the given figure.




          d.   Part-of
          e.   Has-a
          f.   Kind-of
          g.   Is-a




  ©NIIT                      Java Fundamentals               Lesson 2A/Slide 3 of 34
Introduction to Java


Solutions to Pre-assessment
  Questions
   1.     d.
   2.     b.
   3.     c.
   4.     b.
   5.     a




  ©NIIT        Java Fundamentals   Lesson 2A/Slide 4 of 34
Introduction to Java


Objectives
   In this lesson, you will learn about:


          •   Concepts of Java programming language
          •   Variables
          •   Arrays




  ©NIIT                     Java Fundamentals         Lesson 2A/Slide 5 of 34
Introduction to Java


Java Programming Language
    •     Need for Java
           • Java applications are:
                • Character User Interface (CUI) Applications:Has access to the
                   system resources, such as file systems and can read and write to
                   files on local computers.
                • Graphical User Interface (GUI) Applications: Used in the Windows
                   environment.
                • Applets: Are small executable programs that run on a Web page
                   and require a Java-enabled browser, such as Internet Explorer or
                   Netscape Navigator.
                • Servlets:Are the programs that are used to extend the
                   functionality of Web servers.
                • Packages:Are collection of classes that can be reused by
                   applications and applets.



  ©NIIT                      Java Fundamentals              Lesson 2A/Slide 6 of 34
Introduction to Java

Java Programming Language (Contd.)
      •   Characteristics of Java 
             • Simple
             • Object-oriented
             • Compiled and interpreted
             • Portable
             • Distributed
             • Secure




  ©NIIT                   Java Fundamentals   Lesson 2A/Slide 7 of 34
Introduction to Java


Java Programming Language (Contd.)
   •      Java Architecture
          • Various components of Java Architecture are:
              • Java programming language
              • Java class file
              • Java Virtual Machine (JVM)
              • Java Application Programming Interface (API)




  ©NIIT                   Java Fundamentals            Lesson 2A/Slide 8 of 34
Introduction to Java


Java Programming Language (Contd.)
    •     Java Programming Language and class File
           • The Java programming environment




  ©NIIT                   Java Fundamentals          Lesson 2A/Slide 9 of 34
Introduction to Java


Java Programming Language (Contd.)
    •      Java Virtual Machine (JVM)
          • Components of the JVM:
                • Class loader
                • Execution engine
                • Just In Time(JIT) compiler




  ©NIIT                  Java Fundamentals     Lesson 2A/Slide 10 of 34
Introduction to Java


Java Programming Language (Contd.)
   •      Java Application Programming Interface (API)
          • Components of Java platform




  ©NIIT                     Java Fundamentals            Lesson 2A/Slide 11 of 34
Introduction to Java


Java Programming Language (Contd.)
   •      Java architecture security features:
          • Compiler level security
          • Byte code verifier
          • Class loader
          • Sandbox model




  ©NIIT                      Java Fundamentals   Lesson 2A/Slide 12 of 34
Introduction to Java


Java Programming Language (Contd.)
   •      Security levels in Java architecture:




  ©NIIT                      Java Fundamentals    Lesson 2A/Slide 13 of 34
Introduction to Java


Java Programming Language (Contd.)
   •      Bytecode is verified in two phases:
          •  In the first phase, the verifier checks for the structure of the .class file.
          • The second level phase occurs when the Bytecode is run.The Bytecode
               verifier checks the validity of classes, variables, and methods used in a
               program.




  ©NIIT                      Java Fundamentals                 Lesson 2A/Slide 14 of 34
Introduction to Java


Declaring Variables and Literals
   •      The various data types in Java are:
          • Primitive or the simple data types
          • Abstract or the derived data types




  ©NIIT                    Java Fundamentals     Lesson 2A/Slide 15 of 34
Introduction to Java

Declaring Variables and Literals
(Contd.)
     Group     Data            Size             Range              Default
               Type                                                 Value


  Integer    byte          One byte       -27 to 2--7–1            0
                                          (signed)


             short         Two byte       -215 to 215 –1           0


             int           Four byte      -231 to 231-1            0


             long          Eight byte     -263 to 263-1            0




  ©NIIT               Java Fundamentals             Lesson 2A/Slide 16 of 34
Introduction to Java

Declaring Variables and Literals
(Contd.)
    Group           Data             Size              Range              Default
                    Type                                                   Value


 Floating point   float          Four byte      3.4e-038 to               0.0
                                                3.4e+038

                  double         Eight byte     1.7e-308 to               0.0
                                                1.7e+308

 Boolean          boolean        One bit        true or false             false


 Character        char           Two byte       a single character        null




  ©NIIT                     Java Fundamentals             Lesson 2A/Slide 17 of 34
Introduction to Java

Declaring Variables and Literals
(Contd.)
            Data type                 Width (Bits)                 Range
   •       Integer data types and their width and ranges

   byte                         8                          -128 to 127


   short                        16                         -32,768 to 32,767


   int                          32                         -2,147,483,648 to
                                                           2,147,483,647


   long                         64                         -9,223,372,036,854,
                                                           775,808 to 9,223,372,
                                                           036, 854,775,807 


  ©NIIT                      Java Fundamentals             Lesson 2A/Slide 18 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
    •     Floating point data types:
           • Float:Has a range of 32 bits
           • Double:Has a range of 64 bits
    •     Character data type:
           • Has a width of 16-bits
           • Has the set of standard ASCII character ranging from 0 to 127




  ©NIIT                   Java Fundamentals             Lesson 2A/Slide 19 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
    •     Abstract data types:
           • Data types derived from the primitive data types
           • String stores letters, digits, and characters such as as /, (), :, :, $,
                and #.




  ©NIIT                     Java Fundamentals                Lesson 2A/Slide 20 of 34
Introduction to Java

Declaring Variables and Literals
(Contd.)
  •        Keywords available in Java:
      abstract          boolean            break     byte

      case              catch              char      class

      const             continue           default   do

      double            else               extends   final

      finally           float              for       goto

      if                implements         Import    instanceof


  ©NIIT                         Java Fundamentals            Lesson 2A/Slide 21 of 34
Introduction to Java

Declaring Variables and Literals
(Contd.)
  •       Keywords available in Java: (Contd.)

      int                interface        long       native

      new                package          private    protected

      public             return           short      static

      strictfp           super            switch     synchronized

      this               throw            throws     transient

      try                void             volatile   while


  ©NIIT                      Java Fundamentals         Lesson 2A/Slide 22 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
   •      Defining Variables and Literals:
          • A variable is the name that refers to a memory location where some
               data value is stored.
          • Each variable that is used in a program must be declared.




  ©NIIT                    Java Fundamentals             Lesson 2A/Slide 23 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
   •      Naming Conventions for Variables:
          • The name of a variable needs to be meaningful, short, and without any
              embedded space or symbol.
          • A variable name must be unique.
          • A variable name must begin with a letter, an underscore (_), or the
              dollar symbol ($), which can be followed by a sequence of letters or
              digits (0 to 9), ‘$’, or ‘_’ .
          • A variable name should not start with a digit.
          • A variable name should not contain embedded white spaces .
          • A variable name should not consist of a keyword.
          • A variable name in Java is case sensitive.


  ©NIIT                    Java Fundamentals             Lesson 2A/Slide 24 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
   •      Types of Variables:
          • Class variables
          • Instance variables
          • Local variables
          • Static variables
          • Automatic variables




  ©NIIT                  Java Fundamentals   Lesson 2A/Slide 25 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
   •      Literals in Java:
          • Integer literals
          • Floating point literals
          • Character literals
          • String literals
          • Boolean literals




  ©NIIT                     Java Fundamentals   Lesson 2A/Slide 26 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
   •      Manipulating Variables:
              • Assignment Operator
                    • You use the assignment operator (=) to assign a value to a
                        variable.




  ©NIIT                    Java Fundamentals             Lesson 2A/Slide 27 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
          Operator                           Operation


          +          Adds two operands


          -          Subtracts one operand from another”


          *          Multiplies two operands


          /          Divides two operands




  ©NIIT                  Java Fundamentals               Lesson 2A/Slide 28 of 34
Introduction to Java


Declaring Variables and Literals
(Contd.)
           Operator                        Operation


          %           Calculates the modulus


          ++          Increments a variable


          --          Decrements a variable




  ©NIIT                Java Fundamentals               Lesson 2A/Slide 29 of 34
Introduction to Java


Using Arrays
   •      Arrays:
          • One-dimensional arrays
          • Multi-dimensional arrays




  ©NIIT                   Java Fundamentals   Lesson 2A/Slide 30 of 34
Introduction to Java


Using Arrays (Contd.)
   •      Memory allocation to arrays:




  ©NIIT                     Java Fundamentals   Lesson 2A/Slide 31 of 34
Introduction to Java


Summary
In this lesson, you learned:
     • Java is both a language and a technology used to develop desktop and
           Internet-based applications known as Java applications and applets.
     • The various characteristics of Java programming language
           • Simple
           • Object-oriented
           • Compiled and interpreted
           •  Portable
           •  Distributed
           •     Robust
           •     Secure
     •  Various components of the Java architecture are:
           • Java programming language
           •  Java class file
           • Java Virtual Machine
           • Java Application Programming Interface (API).
   ©NIIT                    Java Fundamentals              Lesson 2A/Slide 32 of 34
Introduction to Java


Summary(Contd.)

   •      The JVM converts the bytecode contained in the .class file to machine object
          code.
   •      The various data types defined in Java are:
          • Integers: Include byte, short, int, and long data types.
          • Floating-point numbers: Include double and float data types.
          • Characters: Include char, data type.
          • Boolean: Include boolean, data type.
   •      The built-in or the intrinsic data types in Java are known as the primitive or
             the simple data types.
   •      The abstract data types include the data types derived from the primitive
          data types.
   •      The keywords are the reserved words for a language, which express the
          language features.



  ©NIIT                      Java Fundamentals               Lesson 2A/Slide 33 of 34
Introduction to Java


Summary(Contd.)
   •      A variable is the basic storage unit in Java. It is the name that refers to a
          memory location where some data value is stored.
   •      The various types of variables are:
          • Class variables
          • Instance variable
          • Local variables
          • Static variables
          • Automatic variables
   •      You use operators in Java to manipulate data and variables. The various
          operators are assignment and arithmetic operators.
   •      An array is a group of variables of the same data type and referred to by a
          common name. A specific element of an array can be accessed by its index.
          An array is a block of memory locations.




  ©NIIT                      Java Fundamentals               Lesson 2A/Slide 34 of 34

More Related Content

What's hot

06 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_0806 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_08Niit Care
 
10 iec t1_s1_oo_ps_session_14
10 iec t1_s1_oo_ps_session_1410 iec t1_s1_oo_ps_session_14
10 iec t1_s1_oo_ps_session_14Niit Care
 
12 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_1712 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_17Niit Care
 
11 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_1611 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_16Niit Care
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview QestionsArun Vasanth
 
Class notes(week 9) on multithreading
Class notes(week 9) on multithreadingClass notes(week 9) on multithreading
Class notes(week 9) on multithreadingKuntal Bhowmick
 
Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)smumbahelp
 
Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes Uzair Salman
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19Niit Care
 
Java session13
Java session13Java session13
Java session13Niit Care
 
1909 BERT: why-and-how (CODE SEMINAR)
1909 BERT: why-and-how (CODE SEMINAR)1909 BERT: why-and-how (CODE SEMINAR)
1909 BERT: why-and-how (CODE SEMINAR)WarNik Chow
 
JAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examplesJAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examplesSunil Kumar Gunasekaran
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaGlenn Guden
 
Design pattern application
Design pattern applicationDesign pattern application
Design pattern applicationgayatri thakur
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1Sherihan Anver
 

What's hot (20)

06 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_0806 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_08
 
10 iec t1_s1_oo_ps_session_14
10 iec t1_s1_oo_ps_session_1410 iec t1_s1_oo_ps_session_14
10 iec t1_s1_oo_ps_session_14
 
Java sessionnotes
Java sessionnotesJava sessionnotes
Java sessionnotes
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
12 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_1712 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_17
 
11 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_1611 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_16
 
Intervies
InterviesIntervies
Intervies
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
Class notes(week 9) on multithreading
Class notes(week 9) on multithreadingClass notes(week 9) on multithreading
Class notes(week 9) on multithreading
 
Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)
 
Bert
BertBert
Bert
 
Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19
 
Java session13
Java session13Java session13
Java session13
 
1909 BERT: why-and-how (CODE SEMINAR)
1909 BERT: why-and-how (CODE SEMINAR)1909 BERT: why-and-how (CODE SEMINAR)
1909 BERT: why-and-how (CODE SEMINAR)
 
JAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examplesJAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examples
 
How To Code in C#
How To Code in C#How To Code in C#
How To Code in C#
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
 
Design pattern application
Design pattern applicationDesign pattern application
Design pattern application
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1
 

Viewers also liked

Pastoral coletiva de 1890
Pastoral coletiva de 1890Pastoral coletiva de 1890
Pastoral coletiva de 1890Vanildo Zugno
 
Slideshareelectiva2.kicyramirez
Slideshareelectiva2.kicyramirezSlideshareelectiva2.kicyramirez
Slideshareelectiva2.kicyramirezkicy Ramirez
 
Condivisione di nuove reti in strutture esistenti condivisione cavodotti
Condivisione di nuove reti in strutture esistenti condivisione cavodottiCondivisione di nuove reti in strutture esistenti condivisione cavodotti
Condivisione di nuove reti in strutture esistenti condivisione cavodottiEuropean Services Institute
 
Poluiçao atmosférica 9f
Poluiçao atmosférica 9fPoluiçao atmosférica 9f
Poluiçao atmosférica 9fMayjö .
 
20120126 cbep slideshare
20120126 cbep slideshare20120126 cbep slideshare
20120126 cbep slidesharekojitakahashi
 
Doreen virtue vindecarea-cu_ingeri_0.9_10__
Doreen virtue vindecarea-cu_ingeri_0.9_10__Doreen virtue vindecarea-cu_ingeri_0.9_10__
Doreen virtue vindecarea-cu_ingeri_0.9_10__dalina_claudia
 
Ecosistemas - Eduar Pinzon
Ecosistemas - Eduar PinzonEcosistemas - Eduar Pinzon
Ecosistemas - Eduar Pinzonadriecologia
 
Oral cavity palate - pharynx
Oral cavity   palate - pharynxOral cavity   palate - pharynx
Oral cavity palate - pharynxMohamed El Fiky
 
Git j club colonoscopy mistakes.
Git j club colonoscopy mistakes.Git j club colonoscopy mistakes.
Git j club colonoscopy mistakes.Shaikhani.
 

Viewers also liked (15)

Pastoral coletiva de 1890
Pastoral coletiva de 1890Pastoral coletiva de 1890
Pastoral coletiva de 1890
 
ACTA
ACTAACTA
ACTA
 
Slideshareelectiva2.kicyramirez
Slideshareelectiva2.kicyramirezSlideshareelectiva2.kicyramirez
Slideshareelectiva2.kicyramirez
 
05 seminario-3
05 seminario-305 seminario-3
05 seminario-3
 
2 8 zezinha
2 8 zezinha2 8 zezinha
2 8 zezinha
 
Condivisione di nuove reti in strutture esistenti condivisione cavodotti
Condivisione di nuove reti in strutture esistenti condivisione cavodottiCondivisione di nuove reti in strutture esistenti condivisione cavodotti
Condivisione di nuove reti in strutture esistenti condivisione cavodotti
 
Uniones quimica
Uniones quimicaUniones quimica
Uniones quimica
 
Poluiçao atmosférica 9f
Poluiçao atmosférica 9fPoluiçao atmosférica 9f
Poluiçao atmosférica 9f
 
20120126 cbep slideshare
20120126 cbep slideshare20120126 cbep slideshare
20120126 cbep slideshare
 
Ozono 9f
Ozono 9fOzono 9f
Ozono 9f
 
Doreen virtue vindecarea-cu_ingeri_0.9_10__
Doreen virtue vindecarea-cu_ingeri_0.9_10__Doreen virtue vindecarea-cu_ingeri_0.9_10__
Doreen virtue vindecarea-cu_ingeri_0.9_10__
 
Tradescanner ppt
Tradescanner pptTradescanner ppt
Tradescanner ppt
 
Ecosistemas - Eduar Pinzon
Ecosistemas - Eduar PinzonEcosistemas - Eduar Pinzon
Ecosistemas - Eduar Pinzon
 
Oral cavity palate - pharynx
Oral cavity   palate - pharynxOral cavity   palate - pharynx
Oral cavity palate - pharynx
 
Git j club colonoscopy mistakes.
Git j club colonoscopy mistakes.Git j club colonoscopy mistakes.
Git j club colonoscopy mistakes.
 

Similar to Dacj 1-2 a

Introduction to java
Introduction to java Introduction to java
Introduction to java javeed_mhd
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Phaniu
 
Java Basics
Java BasicsJava Basics
Java BasicsKhan625
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in MuleRajkattamuri
 
Java Introduction
Java IntroductionJava Introduction
Java Introductionjaveed_mhd
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free DownloadTIB Academy
 
Introduction to java
Introduction to java Introduction to java
Introduction to java sanjay joshi
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in MuleAnand kalla
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabadrevanthonline
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptRajeshSukte1
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptCDSukte
 

Similar to Dacj 1-2 a (20)

Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in Mule
 
Java in Mule
Java in MuleJava in Mule
Java in Mule
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Java basic
Java basicJava basic
Java basic
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in Mule
 
Dacj 2-2 a
Dacj 2-2 aDacj 2-2 a
Dacj 2-2 a
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabad
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Dacj 2-1 a
Dacj 2-1 aDacj 2-1 a
Dacj 2-1 a
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 

Recently uploaded

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Dacj 1-2 a

  • 1. Introduction to Java Pre-assessment Questions 1. ______ is the feature of OOPS that implies that the non-essential details of an object are hidden from the user and an access is provided to its essential details. a. Inheritance b. Abstraction c. Polymorphism d. Encapsulation 2. What is the relationship between objects of a superclass and subclass known as?. a. Kind-Of b. Abstraction c. Part-Of d. Has-A ©NIIT Java Fundamentals Lesson 2A/Slide 1 of 34
  • 2. Introduction to Java Pre-assessment Questions (Contd.) 1. Identify the feature of OOPS that means ignoring the non-essential details of an object and concentrating on its essential features? • Inheritance • Encapsulation • Abstraction • Polymorphism • What is the type of inheritance in which a subclass is derived from more than one super class known as? a. Single Inheritance b. Multiple Inheritance c. Multilevel Inheritance d. Hybrid Inheritance ©NIIT Java Fundamentals Lesson 2A/Slide 2 of 34
  • 3. Introduction to Java Pre-assessment Questions (Contd.) 5. Identify the type of relationship shared by the Gear and Automobile class in the given figure. d. Part-of e. Has-a f. Kind-of g. Is-a ©NIIT Java Fundamentals Lesson 2A/Slide 3 of 34
  • 4. Introduction to Java Solutions to Pre-assessment Questions 1. d. 2. b. 3. c. 4. b. 5. a ©NIIT Java Fundamentals Lesson 2A/Slide 4 of 34
  • 5. Introduction to Java Objectives In this lesson, you will learn about: • Concepts of Java programming language • Variables • Arrays ©NIIT Java Fundamentals Lesson 2A/Slide 5 of 34
  • 6. Introduction to Java Java Programming Language • Need for Java • Java applications are: • Character User Interface (CUI) Applications:Has access to the system resources, such as file systems and can read and write to files on local computers. • Graphical User Interface (GUI) Applications: Used in the Windows environment. • Applets: Are small executable programs that run on a Web page and require a Java-enabled browser, such as Internet Explorer or Netscape Navigator. • Servlets:Are the programs that are used to extend the functionality of Web servers. • Packages:Are collection of classes that can be reused by applications and applets. ©NIIT Java Fundamentals Lesson 2A/Slide 6 of 34
  • 7. Introduction to Java Java Programming Language (Contd.) • Characteristics of Java  • Simple • Object-oriented • Compiled and interpreted • Portable • Distributed • Secure ©NIIT Java Fundamentals Lesson 2A/Slide 7 of 34
  • 8. Introduction to Java Java Programming Language (Contd.) • Java Architecture • Various components of Java Architecture are: • Java programming language • Java class file • Java Virtual Machine (JVM) • Java Application Programming Interface (API) ©NIIT Java Fundamentals Lesson 2A/Slide 8 of 34
  • 9. Introduction to Java Java Programming Language (Contd.) • Java Programming Language and class File • The Java programming environment ©NIIT Java Fundamentals Lesson 2A/Slide 9 of 34
  • 10. Introduction to Java Java Programming Language (Contd.) • Java Virtual Machine (JVM) • Components of the JVM: • Class loader • Execution engine • Just In Time(JIT) compiler ©NIIT Java Fundamentals Lesson 2A/Slide 10 of 34
  • 11. Introduction to Java Java Programming Language (Contd.) • Java Application Programming Interface (API) • Components of Java platform ©NIIT Java Fundamentals Lesson 2A/Slide 11 of 34
  • 12. Introduction to Java Java Programming Language (Contd.) • Java architecture security features: • Compiler level security • Byte code verifier • Class loader • Sandbox model ©NIIT Java Fundamentals Lesson 2A/Slide 12 of 34
  • 13. Introduction to Java Java Programming Language (Contd.) • Security levels in Java architecture: ©NIIT Java Fundamentals Lesson 2A/Slide 13 of 34
  • 14. Introduction to Java Java Programming Language (Contd.) • Bytecode is verified in two phases: •  In the first phase, the verifier checks for the structure of the .class file. • The second level phase occurs when the Bytecode is run.The Bytecode verifier checks the validity of classes, variables, and methods used in a program. ©NIIT Java Fundamentals Lesson 2A/Slide 14 of 34
  • 15. Introduction to Java Declaring Variables and Literals • The various data types in Java are: • Primitive or the simple data types • Abstract or the derived data types ©NIIT Java Fundamentals Lesson 2A/Slide 15 of 34
  • 16. Introduction to Java Declaring Variables and Literals (Contd.) Group Data Size Range Default Type Value Integer byte One byte -27 to 2--7–1 0 (signed) short Two byte -215 to 215 –1 0 int Four byte -231 to 231-1 0 long Eight byte -263 to 263-1 0 ©NIIT Java Fundamentals Lesson 2A/Slide 16 of 34
  • 17. Introduction to Java Declaring Variables and Literals (Contd.) Group Data Size Range Default Type Value Floating point float Four byte 3.4e-038 to 0.0 3.4e+038 double Eight byte 1.7e-308 to 0.0 1.7e+308 Boolean boolean One bit true or false false Character char Two byte a single character null ©NIIT Java Fundamentals Lesson 2A/Slide 17 of 34
  • 18. Introduction to Java Declaring Variables and Literals (Contd.) Data type Width (Bits) Range • Integer data types and their width and ranges byte 8 -128 to 127 short 16 -32,768 to 32,767 int 32 -2,147,483,648 to 2,147,483,647 long 64 -9,223,372,036,854, 775,808 to 9,223,372, 036, 854,775,807  ©NIIT Java Fundamentals Lesson 2A/Slide 18 of 34
  • 19. Introduction to Java Declaring Variables and Literals (Contd.) • Floating point data types: • Float:Has a range of 32 bits • Double:Has a range of 64 bits • Character data type: • Has a width of 16-bits • Has the set of standard ASCII character ranging from 0 to 127 ©NIIT Java Fundamentals Lesson 2A/Slide 19 of 34
  • 20. Introduction to Java Declaring Variables and Literals (Contd.) • Abstract data types: • Data types derived from the primitive data types • String stores letters, digits, and characters such as as /, (), :, :, $, and #. ©NIIT Java Fundamentals Lesson 2A/Slide 20 of 34
  • 21. Introduction to Java Declaring Variables and Literals (Contd.) • Keywords available in Java: abstract boolean break byte case catch char class const continue default do double else extends final finally float for goto if implements Import instanceof ©NIIT Java Fundamentals Lesson 2A/Slide 21 of 34
  • 22. Introduction to Java Declaring Variables and Literals (Contd.) • Keywords available in Java: (Contd.) int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while ©NIIT Java Fundamentals Lesson 2A/Slide 22 of 34
  • 23. Introduction to Java Declaring Variables and Literals (Contd.) • Defining Variables and Literals: • A variable is the name that refers to a memory location where some data value is stored. • Each variable that is used in a program must be declared. ©NIIT Java Fundamentals Lesson 2A/Slide 23 of 34
  • 24. Introduction to Java Declaring Variables and Literals (Contd.) • Naming Conventions for Variables: • The name of a variable needs to be meaningful, short, and without any embedded space or symbol. • A variable name must be unique. • A variable name must begin with a letter, an underscore (_), or the dollar symbol ($), which can be followed by a sequence of letters or digits (0 to 9), ‘$’, or ‘_’ . • A variable name should not start with a digit. • A variable name should not contain embedded white spaces . • A variable name should not consist of a keyword. • A variable name in Java is case sensitive. ©NIIT Java Fundamentals Lesson 2A/Slide 24 of 34
  • 25. Introduction to Java Declaring Variables and Literals (Contd.) • Types of Variables: • Class variables • Instance variables • Local variables • Static variables • Automatic variables ©NIIT Java Fundamentals Lesson 2A/Slide 25 of 34
  • 26. Introduction to Java Declaring Variables and Literals (Contd.) • Literals in Java: • Integer literals • Floating point literals • Character literals • String literals • Boolean literals ©NIIT Java Fundamentals Lesson 2A/Slide 26 of 34
  • 27. Introduction to Java Declaring Variables and Literals (Contd.) • Manipulating Variables: • Assignment Operator • You use the assignment operator (=) to assign a value to a variable. ©NIIT Java Fundamentals Lesson 2A/Slide 27 of 34
  • 28. Introduction to Java Declaring Variables and Literals (Contd.) Operator Operation + Adds two operands - Subtracts one operand from another” * Multiplies two operands / Divides two operands ©NIIT Java Fundamentals Lesson 2A/Slide 28 of 34
  • 29. Introduction to Java Declaring Variables and Literals (Contd.) Operator Operation % Calculates the modulus ++ Increments a variable -- Decrements a variable ©NIIT Java Fundamentals Lesson 2A/Slide 29 of 34
  • 30. Introduction to Java Using Arrays • Arrays: • One-dimensional arrays • Multi-dimensional arrays ©NIIT Java Fundamentals Lesson 2A/Slide 30 of 34
  • 31. Introduction to Java Using Arrays (Contd.) • Memory allocation to arrays: ©NIIT Java Fundamentals Lesson 2A/Slide 31 of 34
  • 32. Introduction to Java Summary In this lesson, you learned: • Java is both a language and a technology used to develop desktop and Internet-based applications known as Java applications and applets. • The various characteristics of Java programming language • Simple • Object-oriented • Compiled and interpreted •  Portable •  Distributed • Robust • Secure •  Various components of the Java architecture are: • Java programming language •  Java class file • Java Virtual Machine • Java Application Programming Interface (API). ©NIIT Java Fundamentals Lesson 2A/Slide 32 of 34
  • 33. Introduction to Java Summary(Contd.) • The JVM converts the bytecode contained in the .class file to machine object code. • The various data types defined in Java are: • Integers: Include byte, short, int, and long data types. • Floating-point numbers: Include double and float data types. • Characters: Include char, data type. • Boolean: Include boolean, data type. • The built-in or the intrinsic data types in Java are known as the primitive or the simple data types. • The abstract data types include the data types derived from the primitive data types. • The keywords are the reserved words for a language, which express the language features. ©NIIT Java Fundamentals Lesson 2A/Slide 33 of 34
  • 34. Introduction to Java Summary(Contd.) • A variable is the basic storage unit in Java. It is the name that refers to a memory location where some data value is stored. • The various types of variables are: • Class variables • Instance variable • Local variables • Static variables • Automatic variables • You use operators in Java to manipulate data and variables. The various operators are assignment and arithmetic operators. • An array is a group of variables of the same data type and referred to by a common name. A specific element of an array can be accessed by its index. An array is a block of memory locations. ©NIIT Java Fundamentals Lesson 2A/Slide 34 of 34