A 3 ft x 1ft x 1 ft cage is a 22 gallon cage if you are talking US gallons, or 18 UK gallons.
This is fine to hold a cornsnake. Yes, cornsnakes are friendly, and very good first snakes to get. However, there are right and wrong ways of keeping them, so make sure you do the research on how to keep them well and safely before you get one. The Corn Snake Manual by Kathy Love is a great book containing all the information you need, and you can always come here to ask questions,
Skye