Cramming might work (i.e. get you decent grades in the exams) during the first two years when the material is relatively simple, but if you don't learn the basics well, you might end up having trouble with the more advanced material that will build on the basics.
It might be hard to catch up once you have a gap in your understanding in the early years.
The 7 most important things that enable learning and top grades are:
Listening carefully in class - no just furiously taking notes. Notes can be borrowed from friends, or you can refer to reference materials later. Listen in class!
Ask questions in class - don't be afraid to ask questions. Genuinely engage the professor and participate in class. if you can't follow, others probably can't either.