demo-car/src/main/java/net/risesoft/demo/Example.java

20 lines
459 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package net.risesoft.demo;
public class Example {
public static void main(String[] args) {
Car car = new Car();
System.out.println("当前车辆品牌: ");
System.out.println(car.getName());
System.out.println("当前车辆版本: ");
System.out.println(car.getVersion());
System.out.println("当前 jar 包路径 ");
System.out.println(car.getClass().getProtectionDomain().getCodeSource().getLocation().getPath());
}
}