Kotlin at a Glance
145 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Kotlin at a Glance , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
145 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Basic guide to develop an App in Android by using Kotlin Key features Comprehensive coverage of all the concepts of Kotlin Simple language, crystal clear approach, user friendly book Concepts are duly supported by several examples and self-explanatory analogies. Description "Kotlin at a Glance" is a book that gives an in-depth knowledge about Kotlin. This book mainly focused on Kotlin programming language and its comparison to Java. By reading this book, the readers can make themselves familiar with the language's most important features and aspects.With a complete overview of OOPs, null safety, generics, and many other interesting features, this book is a perfect choice for fresher and experienced Java developers who want to learn more about this alternative JVM language.For reading this book, there's no need for any prior Kotlin knowledge, as the basics are explained in the book. Moreover, the required functional programming concepts are also described.The readers of this book will also learn to develop an app in android using Kotlin. Moreover, this book is for everyone who is on their way of becoming a developer.What will you learn Introduction to OOP, Java, Kotlin Kotlin Architecture, Token, Input, Operator, Array, Function String Operations, Conditional Statements, Jumping Statement Looping / Control Flow / Iteration Null Safety, Kotlin Lambda Functions and Exception Handling Constructor, Inheritance, Abstract Keyword, Polymorphism Collection, Coroutines, Generics Regex, Interoperability with Java, Android Who this book is forThis book will prove to be a "must have" for beginners as well as experienced professionals as it is a stepping stone for learning the technology. Table of contents1. OOP in Brief2. An Introduction to Java3. An Introduction to Kotlin4. Kotlin Architecture5. Kotlin Token6. Kotlin Input7. Kotlin Operator8. String Operations9. Conditional Statements10. Jumping Statement11. Looping / Control Flow / Iteration12. Kotlin Array13. Null Safety14. Kotlin Function15. Function Scope16. Kotlin Lambda Functions and Exception Handling17. Kotlin OOPs18. Constructor19. Inheritance20. Abstract Keyword21. Polymorphism22. Collection23. Coroutines24. Generics25. Regex26. Interoperability with Java27. Kotlin for Android28. Extras29. Interoperability with JavaScript30. Glossary About the authorSwati Saxena is expert in Java programming and coding as she is MCA,OCJP ( Oracle Certified Java Professional ) and ADST , having in-depth knowledge of subject and very vast experience in developing and training. Her knowledge and teaching is always praised by her mentor as well as students. She has written "C programming and coding Question Bank with solution', "Java-A Complete Practical Solution" for BPB Publications. The alumnus of her, are well placed in many reputed organisations all over India.

Sujets

Informations

Publié par
Date de parution 20 septembre 2019
Nombre de lectures 0
EAN13 9789388511544
Langue English

Informations légales : prix de location à la page 0,0600€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

Kotlin at a Glance
By Swati Saxena
FIRST EDITION 2019
Copyright © BPB Publication, INDIA
ISBN: 978-93-8851-149-0
All Rights Reserved. No part of this publication can be stored in a retrieval system or reproduced in any form or by any means without the prior written permission of the publishers
LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY
The Author and Publisher of this book have tried their best to ensure that the programmes, procedures and functions described in the book are correct. However, the author and the publishers make no warranty of any kind, expressed or implied, with regard to these programmes or the documentation contained in the book. The author and publisher shall not be liable in any event of any damages, incidental or consequential, in connection with, or arising out of the furnishing, performance or use of these programmes, procedures and functions. Product name mentioned are used for identification purposes only and may be trademarks of their respective companies.
All trademarks referred to in the book are acknowledged as properties of their respective owners.
Distributors:
BPB PUBLICATIONS 20, Ansari Road, Darya Ganj New Delhi-110002 Ph: 23254990/23254991
 
MICRO MEDIA Shop No. 5, Mahendra Chambers, 150 DN Rd. Next to Capital Cinema, V.T. (C.S.T.) Station, MUMBAI-400 001 Ph: 22078296/22078297
 
BPB BOOK CENTRE 376 Old Lajpat Rai Market, Delhi-110006 Ph: 23861747
 
DECCAN AGENCIES 4-3-329, Bank Street, Hyderabad-500195 Ph: 24756967/24756400
 
 
Published by Manish Jain for BPB Publications, 20, Ansari Road, Darya Ganj, New Delhi-110002 and Printed by Repro India Pvt Ltd, Mumbai
 
 
Dedication
 
I would like to dedicate this book to my parents, without whom my life would not have any meaning. Thank you so much for all your unconditional support, love, and education. Everything I am, I owe to my parents.
Preface
In 2017, Google announced Kotlin as an official language for Android app development.
Kotlin is an open source programming language that combines object-oriented programming and functional features into a unique platform.
It runs on the Java Virtual Machine ( JVM ), and can also be compiled to JavaScript and machine code.
Chapter 1 , OOP in Brief , covers OOPs features deeply.
Chapter 2 , An Introduction to Java , gives a complete idea of the Java language.
Chapter 3 , An Introduction to Kotlin , introduces you to Kotlin.
Chapter 4 , Kotlin Architecture , takes you deep in Kotlin architecture and guides you to set up the IDE.
Chapter 5 , Kotlin Token , gives a detailed knowledge about Kotlin Token.
Chapter 6 , Kotlin Input , teaches you how to input in Kotlin and casting.
Chapter 7 , Kotlin Operator , focuses on Kotlin operators.
Chapter 8 , String Operations , focuses on the various string operations.
Chapter 9 , Conditional Statements , revises the conditional statements.
Chapter 10 , Jumping Statement , gives an idea of jumping statement.
Chapter 11 , Looping / Control Flow / Iteration , focuses on iteration.
Chapter 12 , Kotlin Array , defines Kotlin array.
C hapter 13 , Null Safety , tells you how to do null safety and use elvis operator.
Chapter 14 , Kotlin Function , discusses the various Kotlin functions.
Chapter 15 , Function Scope , tells about function scope.
Chapter 16 , Kotlin Lambda Functions and Exception Handling , focuses on Kotlin lambda function and exception handling.
Chapter 17 , Kotlin OOPs , gives an idea on Kotlin as an OOP language.
Chapter 18 , Constructor , tells about constructors.
Chapter 19 , Inheritance , focuses on inheritance.
Chapter 20 , Abstract Keyword , discusses about abstract keyword.
Chapter 21 , Polymorphism , covers polymorphism.
Chapter 22 , Collection , coves collection interface in depth.
Chapter 23 , Coroutines , introduces coroutines in Kotlin.
Chapter 24 , Generics , covers Generics in Kotlin
Chapter 25 , Regex , discusses about Regex.
Chapter 26 , Interoperability with Java , tells how to do interoperability with Java.
Chapter 27 , Kotlin for Android , tells how to use Kotlin in Android.
Chapter 28 , Extras , covers some extras to cover topics which are important yet not discussed earlier.
C hapter 29 , Interoperability with JavaScript , tells interoperability of Kotlin with JavaScript.
It is advisable to practice C Programming and Coding Question Bank with solution and Java A complete practical solution when practicing this book for strong programming concept.
A lthough care has been taken for accuracy, the possibility of minor inaccuracies cannot be ruled out.
 
Lastly, thank you to all students who believe in me.
 
All the Best.
Swati Saxena
Table of Contents
Chapter 1: OOP in Brief
Advantage of OOPs Over Procedure-oriented Programming Language
Features of OOP
Abstraction
Encapsulation
Inheritance
Polymorphism
Chapter 2: An Introduction to Java
Java Tokens
Selection Statements
Iteration Statements
Jumping Statements
Object and Classes
Type System
Object Class and its Methods
Polymorphism and Inheritance
Overriding
Constructor
Final and Static
The this Keyword
Interface and Abstract Class
Abstract Class
Interface
Garbage Collection
The Finalize() Method
Package
Multithreading
Exception Handling
Chapter 3 An Introduction to Kotlin
History of Kotlin
Versions of Kotlin
An introduction to Kotlin
Why Kotlin?
Philosophy behind Kotlin
Chapter 4: Kotlin Architecture
JDK (Java Development Kit)
Setting up Kotlin in IntelliJ IDEA
Setting up Kotlin in Eclipse
How to Write Program in Kotlin?
Chapter 5: Kotlin Token
Comments
Variables
Datatypes
Kotlin String Literals
Kotlin String Equality
Chapter 6: Kotlin Input
Kotlin Type Conversion
The is Operator
Explicit Cast Operator “as”
Chapter 7: Kotlin Operator
Chapter 8: String Operations
String Replace
Split String
Split String to Lines
String Capitalize
Chapter 9:Conditional Statements
if…else
when…else
Chapter 10: Jumping Statement
Chapter 11: Looping / Control Flow / Iteration
The for Loop
The While Loop
The do…while Loop
The Repeat Statement
Chapter 12: Kotlin Array
Chapter 13: Null Safety
Elvis Operator ?:
The !! Operator (double bang operator)
Chapter 14: Kotlin Function
Spread Operator
Recursion and Tail Recursion
Chapter 15: Function Scope
Top Level Functions
Member Functions
Chapter 16: Kotlin Lambda Functions and Exception Handling
Exception
Types of Exceptions
Chapter 17: Kotlin OOPs
Nested Class
Inner Class
Companion Object
Reflection
Chapter 18: Constructor
Getter or Setter to Set Value of Properties
Chapter 19: Inheritance
Chapter 20: Abstract Keyword
Chapter 21: Polymorphism
Operator Overloading
Data Class
Sealed Class
Inline Class
Chapter 22: Collection
Properties of Map Interface
Functions of Map Interface
Properties of Set Interface
Functions of Set Interface
Chapter 23: Coroutines
Chapter 24: Generics
Delegation
Destructing Declaration
Chapter 25: Regex
Chapter 26: Interoperability with Java
Chapter 27: Kotlin for Android
Chapter 28: Extras
Chapter 29: Interoperability with JavaScript
Representing Kotlin Types in JavaScript
Calling Kotlin from JavaScript
Kotlin Plugin
Glossary
Hard Keywords
Soft Keywords
Modifier Keywords
Special Identifiers
Operators and Special Symbols
Important Question
C HAPTER 1
OOP in Brief
OOP stands for object-oriented programming, refers to a programming methodology based on objects, instead of just functions and procedures.

Advantage of OOPs Over Procedure-oriented Programming Language
OOPs makes development and maintenance easier, where as, in procedure-oriented programming language, it is not easy to manage the code if it grows as the project size grows.
OOPs provides data hiding, whereas, in procedure-oriented programming language, a global data can be accessed from anywhere.
OOPs provides the ability to simulate real-world events much more effectively.
We can provide the solution of real world problem if we are using object-oriented programming languages.
What is an object?
An object is an entity which has a well-defined structure and behavior. Everything in world is an object if it has some identity, state, behavior, and responsibility.
Characteristics of an object:
State
Behavior
Identity
Responsibility

Features of OOP
The features of OOP are as follows:
Abstraction
Encapsulation
Inheritance
Polymorphism

Abstraction
Abstraction is the process of identifying the key aspects of an entity and ignoring the rest. Data abstraction is a programming (and design) technique that relies on the separation of interface and implementation.
Advantages of data abstraction are:
It makes the application secure by making data private and avoiding the user-level error that may corrupt the data
It avoids code duplication
For example, a man has all the following properties but according to the need he is asked for the following information: Social Survey Health Care Employment
Name
Name
Name
Age
Age
Age
Marital status
Address
Address
Religion
Blood group
Qualification
Income group
Weight
Department
Address
Previous record
Job responsibility
…….
……..
……..

Encapsulation
Encapsulation is a mechanism used to hide the data, internal structure, and implementation details of an object.
Data encapsulation led to the important OOP concept of data hiding. Data encapsulation is a mechanism of bundling the data, and the functions that use them and data abstraction is a mechanism of exposing only the interfaces and hiding the implementation details from the user.
C++ supports the properties of encapsulation and data hiding through the creation of user-defined types, called classes .
Advantages of encapsulation:
Encapsulation is useful in hiding the data of a class from an illegal direct access

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents