KT-5287 J2K: Convert class with private constructor and static functions to "object" instead of class with "class object"

#KT-5287 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-03-27 13:55:47 +03:00
parent 6dbb13c32d
commit f19eb20803
63 changed files with 550 additions and 482 deletions
+8 -10
View File
@@ -1,16 +1,14 @@
package switch_demo
public class SwitchDemo {
companion object {
public fun main(args: Array<String>) {
val month = 8
val monthString: String
when (month) {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 -> monthString = "December"
else -> monthString = "Invalid month"
}
System.out.println(monthString)
public object SwitchDemo {
public fun main(args: Array<String>) {
val month = 8
val monthString: String
when (month) {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 -> monthString = "December"
else -> monthString = "Invalid month"
}
System.out.println(monthString)
}
}