Kotlin is like java
Java
var myVariable = 42
myVariable = 50
val myConstant = 42
val age = 42
if (age < 10) {
println("You're too young to watch this movie")
} else if (age < 13) {
println("You can watch this movie with a parent")
} else {
println("You can watch this movie")
}const val SYSTEM_DEPRECATED: String = "System is deprecated"val explicitDouble: Double = 70.0
println("Hello, world!")
// if is an expression, so ternary operation not needed
val loaded = true
val status = if (loaded) "Ready" else "Loading..."
// "Readyval apples = 3
val oranges = 5
val fruitSummary = "I have ${apples + oranges} " +
"pieces of fruit."
val label = "The width is "
val width = 94
val widthLabel = label + width
// The width is 94
Also in Java:
- Title
- java check if args is empty
- Category
- Java
- Title
- java function for power
- Category
- Java
- Title
- labeled for loop in java
- Category
- Java
- Title
- deleting elements of an array in java
- Category
- Java
- Title
- actionListener java
- Category
- Java
- Title
- remove space string java
- Category
- Java
- Title
- jsonobject to java object
- Category
- Java
- Title
- java replace all html tags
- Category
- Java
- Title
- read int from keyboard java
- Category
- Java
- Title
- how to loop through an array
- Category
- Java
- Title
- java making a screen
- Category
- Java
- Title
- @JsonSerializer spring specific field string to date
- Category
- Java
- Title
- how to use beacon power in minecraft in java edition
- Category
- Java
- Title
- java string to char array
- Category
- Java
- Title
- how to reverse a list in java
- Category
- Java
- Title
- java how to change the length of an array
- Category
- Java
- Title
- what is a float java
- Category
- Java
- Title
- java == vs equals
- Category
- Java
- Title
- how to check if a list is empty java
- Category
- Java
- Title
- java list as parameter
- Category
- Java
- Title
- java set example
- Category
- Java
- Title
- how to byheart faster
- Category
- Java
- Title
- Java nested array hashcode
- Category
- Java
- Title
- Java sort Map by values
- Category
- Java
- Title
- Method used for getting metadata of a database in jdbc
- Category
- Java
- Title
- file with line numbers inserted java
- Category
- Java
- Title
- How to create a 2d array in java
- Category
- Java
- Title
- java check if directory exists
- Category
- Java
- Title
- how to draw a triangle in java
- Category
- Java
- Title
- java newinstance alternative
- Category
- Java
- Title
- Java arraylist if you don't want to use add()
- Category
- Java
- Title
- check if map contains key java
- Category
- Java
- Title
- get cursor position in textarea java
- Category
- Java
- Title
- add view to relativelayout programmatically
- Category
- Java
- Title
- java random number
- Category
- Java
- Title
- pascals triangle java
- Category
- Java
- Title
- difference between compile and execute in java
- Category
- Java
- Title
- getindexrequest elasticsearch
- Category
- Java
- Title
- sdkmanager JAVA_HOME invalid directory
- Category
- Java
- Title
- write in file java
- Category
- Java
- Title
- spring framework iterate
- Category
- Java
- Title
- binary to int java
- Category
- Java
- Title
- how to import jframe in java
- Category
- Java
- Title
- java program to display characters from a to z using loop
- Category
- Java
- Title
- eliminar fila jtable java
- Category
- Java
- Title
- in java how to compare two strings
- Category
- Java
- Title
- how to convert a jsonobject to a dbobject
- Category
- Java
- Title
- crit chance in java
- Category
- Java
- Title
- find frequency of each word in a string in java
- Category
- Java
- Title
- primitive data types in java
- Category
- Java
- Title
- java startActivity crash
- Category
- Java
- Title
- hide element selenium
- Category
- Java
- Title
- java treeset
- Category
- Java
- Title
- diagonal difference hackerrank solution in java 8 using list
- Category
- Java
- Title
- java regex replace all characters before
- Category
- Java
- Title
- input java
- Category
- Java
- Title
- creating a program about user asked to enter a number and enters 0 to stop, then calculates the sum of numbers entered, the average, the length of positive numbers and negative numbers entered by the user in java
- Category
- Java
- Title
- imageview.setbackground
- Category
- Java
- Title
- biginteger in java
- Category
- Java
- Title
- java boolean even number
- Category
- Java
- Title
- jar file not running after being compiled
- Category
- Java
- Title
- para que sirve getcontentpane en java
- Category
- Java
- Title
- loop collection android
- Category
- Java
- Title
- Scanner library showing element not found exception
- Category
- Java
- Title
- java is power of 2
- Category
- Java
- Title
- discord jda remove @everyone from channel
- Category
- Java
- Title
- inheritance in java
- Category
- Java
- Title
- how to do 4th root java
- Category
- Java
- Title
- setbackground java
- Category
- Java
- Title
- thread sleep java
- Category
- Java
- Title
- java - get open ports
- Category
- Java
- Title
- java fx display simple rectangle
- Category
- Java
- Title
- java how to show an array
- Category
- Java
- Title
- java clone method
- Category
- Java
- Title
- java script to detect and launch all browsers
- Category
- Java
- Title
- print a list java
- Category
- Java
- Title
- create object of static class in java
- Category
- Java
- Title
- get host from request object java
- Category
- Java
- Title
- java how to put a string sentence in a map
- Category
- Java
- Title
- set color of text for jlabel
- Category
- Java
- Title
- java find biggest number in array
- Category
- Java
- Title
- java simple jframe example
- Category
- Java
- Title
- how to check if the file has remaining without reading from it java
- Category
- Java
- Title
- room insert and return id
- Category
- Java
- Title
- java string reverse
- Category
- Java
- Title
- java return new instance of generic type
- Category
- Java
- Title
- java implement interface
- Category
- Java
- Title
- spring data jpa inheritance repository
- Category
- Java
- Title
- how to make a list java
- Category
- Java
- Title
- java null pointer exception
- Category
- Java
- Title
- how to create java jframe in eclipse
- Category
- Java
- Title
- import java.util.*;
- Category
- Java
- Title
- android how to split string
- Category
- Java
- Title
- reverse array in java
- Category
- Java
- Title
- java swing change label icon
- Category
- Java
- Title
- java previous permutation
- Category
- Java
- Title
- how to get array input in java
- Category
- Java
- Title
- android clear specific sharedpreference value
- Category
- Java
- Title
- java literals w3schools
- Category
- Java
- Title
- string to arraylist convert java
- Category
- Java