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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user