报错:Type mismatch: cannot convert from Object to Car
问题描述: 一个非常简单的spring项目,用静态工厂方法配置bean实例。项目的目录结构如下: 代码如下: Car.java 1 package com.tt.spring.beans.factory; 2 3 public class Car { 4 5 private String brand; 6 private double price; 7 8 public String getBrand() { 9 return brand; 10 } 11 public void setBrand(String brand) { 12 this.brand = brand; 13 } 14 public double getPrice() { 15 return price; 16 } 17 public void setPrice(double price) { 18 this.price = price; 19 } 20 21 public Car(){ 22 System.out.println("Car's Constructor..."); 23 } 24 25 26 27 public Car(String brand, double price) { 28 super(); 29 this.brand = brand; 30 this.price = price;