What's being used in the first example is the initialization list, which is the preferred method to initialize class members (and in some cases the only possible one).
Though in many cases both have exactly the same result as @Athar mentioned it's the preferred way to initialize your data members.
There are some reasons for that. For example for non build-in objects you actually initialize your object twice or to be more correct you don't initialize twice but you use assignment to give your data members values (they have previously been initialized to default values).
Also in some cases you can only use the 1st method. If you want to initialize a data member of your base class (supposed there is one) you can do it only there.
In addition to that, there are some other cases where you can only use the initialization list.
Those being when there isn't a default constructor for a member, or when you have a constant or a reference as a class member.
Accroding to the your suggestions, if I want to practice the code myself, can I change the way it coded in the first method with my own way, or I have to learn the coding way in the book?
Yes, you have to. Constructor initialization lists aren't something you can just skip over when learning C++ (not that it's complicated - learning all the litte details and facets of how it works should take about two minutes).
if I want to practice the code myself, can I change the way it coded in the first method with my own way
Yes, you can. In this particular example, both variants do the same.