本文共 1963 字,大约阅读时间需要 6 分钟。
Here, we will create a Kotlin program to print Kotlin, JVM version (printing Java properties). As Kotlin can be seen as an upgrade of Java, so we will get all versions of java (JVM) using Kotlin also.
在这里,我们将创建一个Kotlin程序以打印JVM版本的Kotlin(打印Java属性) 。 由于Kotlin可以看作是Java的升级,因此我们也将使用Kotlin获得所有版本的Java(JVM)。
package com.includehelp.basic// Main Function Entry Point of Programfun main(args: Array) { println("Kotlin Version : ${KotlinVersion.CURRENT} ") println("Java Version : ${ System.getProperty("java.version") } ") println("Java VM Version : ${ System.getProperty("java.vm.version") } ") println("Java VM Vendor : ${ System.getProperty("java.vm.vendor") } ") println("Java VM Name : ${ System.getProperty("java.vm.name") } ") println("Java VM specification Version : ${ System.getProperty("java.vm.specification.version") }" ) println("Java VM specification Vendor : ${ System.getProperty("java.vm.specification.vendor") }" ) println("Java VM specification Name : ${ System.getProperty("java.vm.specification.name") }" ) println("Java Runtime specification Version : ${ System.getProperty("java.specification.version") }" ) println("Java Runtime specification Vendor : ${ System.getProperty("java.specification.vendor") }" ) println("Java Runtime specification Name : ${ System.getProperty("java.specification.name") }" )}
Output
输出量
Kotlin Version : 1.3.71Java Version : 1.8.0_66Java VM Version : 25.66-b18Java VM Vendor : Oracle CorporationJava VM Name : Java HotSpot(TM) 64-Bit Server VMJava VM specification Version : 1.8Java VM specification Vendor : Oracle CorporationJava VM specification Name : Java Virtual Machine SpecificationJava Runtime specification Version : 1.8Java Runtime specification Vendor : Oracle CorporationJava Runtime specification Name : Java Platform API Specification
翻译自:
转载地址:http://owxzd.baihongyu.com/