Whatthisbookcovers
Chapter1,GettingStartedwithKotlin,covershowtoinstallKotlin,theJetbrainsIntellijIDEA,
andtheGradlebuildsystem.Oncethesetupofthetoolchainiscomplete,thechaptershowshow
towriteyourfirstKotlinprogram.
Chapter2,KotlinBasics,divesheadfirstintothebasicsofKotlin,includingthebasictypes,
basicsyntax,andprogramcontrolflowstructuressuchasifstatements,forloops,andwhile
loops.ThechapterconcludeswithKotlin-specificadditionssuchaswhenexpressionsandtype
inference.
Chapter3,Object-OrientedCodeinKotlin,focusesontheobject-orientatedaspectsofthe
language.Itintroducesclasses,interfaces,objectsandtherelationshipbetweenthem,subtypes,
andpolymorphism.
Chapter4,FunctionsinKotlin,showsthatfunctions,alsoknownasproceduresormethods,are
thebasicbuildingblocksofanylanguage.Thischaptercoversthesyntaxforfunctions,including
theKotlinenhancementssuchasnamedparameters,defaultparameters,andfunctionliterals.
Chapter5,HigherOrderFunctionsandFunctionalProgramming,focusesonthefunctional
programmingsideofKotlin,includingclosures--alsoknownaslambdas--andfunctionreferences.
Itfurthercoversfunctionalprogrammingtechniquessuchaspartialapplication,function
composition,anderroraccumulation.
Chapter6,Properties,explainsthatpropertiesworkhandinhandwithobject-orientated
programmingtoexposevaluesonaclassorobject.Thischaptercovershowpropertieswork,
howtheusercanbestmakeuseofthem,andalsohowtheyarerepresentedinthebytecode.
Chapter7,NullSafety,Reflection,andAnnotations,explainsthatnullsafetyisoneofthemain
featuresthatKotlinprovides,andthefirstpartofthischaptercoversindepththewhysandhows
ofnullsafetyinKotlin.Thesecondpartofthechapterintroducesreflection--runtime
introspectionofcode--andhowitcanbeusedformetaprogrammingwithannotations.
Chapter8,Generics,explainsthatgenerics,orparameterizedtypes,areakeycomponentofany
advancedtypesystem,andthetypesysteminKotlinissubstantiallymoreadvancedthanthat
availableinJava.Thischaptercoversvariance,thetypesystemincludingtheNothingtype,and
algebraicdatatypes.
Chapter9,DataClasses,showsthatimmutabilityandboiler-platefreedomainclassesarea
currenthottopic,duetothewaytheyfacilitatemorerobustcodeandsimplifyconcurrent
programming.Kotlinhasmanyfeaturesfocusedonthisarea,whichitcallsdataclasses.
Chapter10,Collections,explainsthatcollectionsareoneofthemostcommonlyusedaspectsof
anystandardlibrary,andJavacollectionsarenodifferent.Thischapterdescribesthe