You've got a lot of fundamental problems here. It may be more prudent to return to Chapters 2 or 3, before trying 6.
I digress, your Car class is fine. Your CarDemo...has issues.
Line 15
int s = speed;
speed is not defined anywhere. If you're trying to access Car.speed, then you need to instantiate a Car object and use the getSpeed() method. According to the Car class, it might look like this:
// year, make/model, current speed
Car car = new Car(2005, "Jeep Wrangler Rubicon", 0);
Line 13-20
public static void main(String[] args)
{
....
{
This last hanging bracket doesn't belong to a method or a constructor. Did you intend it to?
Lines 18-21
String c;
{
Car c = new Car(2012, "Mercedes-Benz S55 AMG");
You define c as a String, then try to define it as a Car class. Most likely you wanted a Car class all along, remove String c.
Lines 21-23
Car c = new Car(2012, "Mercedes-Benz S55 AMG");
int s = 0;
s = c.getSpeed();
Your Car constructor takes 3 inputs: year, make/model, and current speed. You have only given it 2. Then you set s to 0 and then to your car's current speed (but you haven't defined your car's current speed in the constructor. You were probably looking for something like this:
Car car = new Car(2012, "Mercedes-Benz S55 AMG", 0);
int speed = car.getSpeed();
There are more errors, but its not worth the effort to explain them. You need to go back to the very early chapters of whatever book you are working through and re-read the fundamentals of class and method creation.