在下面的代码中,如何到达内部类'wheel'?
public class InstantiateClass {
public static void main(String[] args) {
Car c = new Car();
//not sure how to get an instance of 'Wheel' here
}
}
class Car{
public static class Wheel{
}
}
答案 0 :(得分:4)
Car.Wheel w = new Car.Wheel();
应该这样做。