The legal drinking age in Germany is 16 years for low-alcohol drinks (such as beer) and 18 years for spirits.
Yes, you can drink in public in Germany. Whether you are walking down the street or riding in a train, you are free to drink whatever you like in public. Depending on whether or not a soccer game is going on, the number of people doing so however is often rather low, and most noticeable near bars and clubs at night. Keep in mind, though, that in some instances, like in a designated opean-air area on New Year's eve, drinking is prohibited and you will be searched for any alcohol, but those instances concern holiday events and are rare.
As a general point, if you're going to drink in public, make sure that any bottles that don't have a deposit (Pfand) make it into a trash can. However, if you want to do a solid by the typically homeless individuals which will look in the city trash cans for deposit bottles, leave them next to the trash can. They'll get taken.
Also, just because you can drink in public, doesn't mean you have a license to be a public nuisance. Germany is a country that feels strongly about teaching young people how to handle drinking alcohol responsibly, and as a point of order, Germans don't much appreciate and aren't terribly interested in dealing with intoxicated individuals. So if you decide to drink in public, remember to behave well, too.