Institute of Engineering &Technology SEMINAR ON KOTLIN SACHIN 141231030242 BUNDELKHAND UNIVERSITY JHANSI
KOTLIN-?
Contents  Introduction  History  Features of Kotlin programming language  Basic syntax  Difference Between kotlin and java  Conclusion
Introduction • Kotlin is a statically-typed programming language • It is jvm targeted language • It support object oriented programing and functional programing feature • It can also can be compiled to JavaScript source code • Its primary development is from a team of JetBrains
History…  In July 2011 JetBrains Start Project Kotlin, a new language for the JVM, which had been under development for a year.  JetBrains hopes that the new language will drive IntelliJ IDEA sales.  Kotlin v1.0 was released on February 15, 2016.  In may 2017 Google I/O Declared as the First class language for android development
Features of Kotlin programming language • Kotlin is open source. • Full Java Interoperability. • Kotlin compiles to JVM bytecode or JS. • Null Safety in Kotlin. • Kotlin wants you to write less code. • Higher order function
Basic syntax  PACKAGE:-  Package specification should we at the top of the application similar to java  Example- package Bu.Iet; import java.util;//import util package  Defining local variables  Example- var a:Int=12//immediate assignment var a=123;//type inference
Difference Between Kotlin and java No Semicolons  // Java System.out.println("Hello world!); // Kotlin println("Hello world!")
No 'new' // Java  Boa a = new Boa(); // Kotlin  val a = Boa()
No Checked Exceptions • // Java code often looks like this • Try • { • Connection con=DriverManager.getConnection()//this sta throw an checked exception • } catch(SqlException r) • { • } • // Kotlin has no checked exception
Type Inference // Java  Int a = 1;  String b = “sachin";  Program p;  // Kotlin  var a = 1  var b = “sachin"  var p: Program
Size of Code • // Java • class Person • { • String firstName; Person(String firstName) { this.firstName = firstName; • } • } • // Kotlin class with primary constructor • class Person(firstName: String)
Data Classes • // Java • To hold the data we must make simple classes with getter and setter method in data • // Kotlin • In kotlin they provide the concept od data classes to hold the data • To define an data class in kotlin we use the keyword data before the class keyword • data class Student(val name: String,val age: int)
Any Queries
Kotlin Language powerpoint show file

Kotlin Language powerpoint show file

  • 1.
    Institute of Engineering&Technology SEMINAR ON KOTLIN SACHIN 141231030242 BUNDELKHAND UNIVERSITY JHANSI
  • 2.
  • 3.
    Contents  Introduction  History Features of Kotlin programming language  Basic syntax  Difference Between kotlin and java  Conclusion
  • 4.
    Introduction • Kotlin isa statically-typed programming language • It is jvm targeted language • It support object oriented programing and functional programing feature • It can also can be compiled to JavaScript source code • Its primary development is from a team of JetBrains
  • 5.
    History…  In July2011 JetBrains Start Project Kotlin, a new language for the JVM, which had been under development for a year.  JetBrains hopes that the new language will drive IntelliJ IDEA sales.  Kotlin v1.0 was released on February 15, 2016.  In may 2017 Google I/O Declared as the First class language for android development
  • 6.
    Features of Kotlinprogramming language • Kotlin is open source. • Full Java Interoperability. • Kotlin compiles to JVM bytecode or JS. • Null Safety in Kotlin. • Kotlin wants you to write less code. • Higher order function
  • 7.
    Basic syntax  PACKAGE:- Package specification should we at the top of the application similar to java  Example- package Bu.Iet; import java.util;//import util package  Defining local variables  Example- var a:Int=12//immediate assignment var a=123;//type inference
  • 8.
    Difference Between Kotlinand java No Semicolons  // Java System.out.println("Hello world!); // Kotlin println("Hello world!")
  • 9.
    No 'new' // Java Boa a = new Boa(); // Kotlin  val a = Boa()
  • 10.
    No Checked Exceptions •// Java code often looks like this • Try • { • Connection con=DriverManager.getConnection()//this sta throw an checked exception • } catch(SqlException r) • { • } • // Kotlin has no checked exception
  • 11.
    Type Inference // Java Int a = 1;  String b = “sachin";  Program p;  // Kotlin  var a = 1  var b = “sachin"  var p: Program
  • 12.
    Size of Code •// Java • class Person • { • String firstName; Person(String firstName) { this.firstName = firstName; • } • } • // Kotlin class with primary constructor • class Person(firstName: String)
  • 13.
    Data Classes • //Java • To hold the data we must make simple classes with getter and setter method in data • // Kotlin • In kotlin they provide the concept od data classes to hold the data • To define an data class in kotlin we use the keyword data before the class keyword • data class Student(val name: String,val age: int)
  • 15.