5. Kotlin
Morden Programming Language
Developed by JetBrains
New native and official language for Android
Run on JVM likes Java
Inter-operable with Java
Unveiled in 2011 and now reach v1.2
Java, Scala, Groovy, C#, Gosu, JavaScript,
Pascal
6. Key Feature
Open source
Type Safe
Null Safe
Client,Server side language – Spring, JSF
Window application – TornadoFX frameworks
Iphone or Ios - CLion
7. Syntax
1. Main
fun main(args : Array<String>){}
2. Variables
var - mutable
val - imutable
3. Function
fun to create function
Unit and return value type
val a : Int = 1
var str : String
str = “hello”
fun sum(a : Int = 1) : Int = a.plus(2)
fun sum(a : Int = 1) = println(a.plus(2))
8. Syntax
4. Extension Function
fun Int.doubleIt() : Int = this * 2
5. OOP Language
class Main{}
6. No static , No new, No switch
There is no static, new and switch keyword
7. Subclassing
Subclassing with ( : )
12. Swift
Morden Programming Language
Developed by Apple
New native and official language for ios,iphone
Not parallel scripting language
Inter-operable with Objective C
Unveiled in 2014 and now reach v4.0.3
Objective-C, Rust, Haskell, Ruby, Python, C#
13. Key Feature
Open source
Type Safe
Null Safe
Client, Server side language – Perfect, VSC
Window application – Swift for window tool
Android - Scade
14. Syntax
1. Main
@UiApplicationMain
2. Variables
var - mutable
let - imutable
3. Function
func to create function
Void and return value type
let a : Int = 1
var str : String
str = “hello”
func sum(a : Int) -> Int = return 0
func sum(a : Int) -> println(a+2)
15. Syntax
4. Multiple return values
func largestAndSmallest(intArray : [Int]) -> (Int,Int)
{
var largest = intArray[0]
var smallest = intArray[0]
for index in 1..<intArray.count {
if largest< intArray[index] {
largest = intArray[index]
}
if smallest > intArray[index] {
smallest = intArray[index]
}
}
return(largest,smallest)
}
var (m,n) = largestAndSmallest([1,5,9,2])
println(“Max is (m) and Min is (n)”)
20. Key Feature
Open source
Type Safe
Null Safe
Client,Server side language
Window application – Dart VM command-line
ios and Android from single codebase with
Flutter SDK
21. Syntax
1. Main
main(){}
2. Variables
int, String
var, num
3. Function
void and return value type
var = 1;
String str;
str = “hello”;
int sum(int a) => return a+2;
void sum(int a) => println(a+2) ;