Ok, first I voted "neither" on the poll, as I take this question to mean "which one should YOU buy."
As usual, I find myself agreeing with Dillinger, in addition to a couple others who posted.
First, not enough information from you. What are you going to use it for? I don't mean robbing banks and such like Dillinger would . Are you going to use it for concealed carry? Target practice? Home protection? How many rounds do you want to be able to carry.
Second, how familiar are you with semi-auto handguns? I'm not making fun of you here. As a former Law Enforcement Officer I carried a Colt 1911 .45 locked and cocked in the holster (made the boss and range Officer crazy), but NEVER an accidental discharge in over 20 years (the first 8 were Revolver days, and none there either).
Third, what caliber are you looking at? I wouldn't think of carrying less than .40 cal. As an old .45 ACP guy at heart, that's all I own, except for the 2 revolvers I had early on plus my last acquisition, a Taurus "Night Judge" that shoots the .45 Colt or .410 shot shells (hey, my wife wanted it ). ANY round will do the job. I'm personally not real fond of the 9mm after a situation where I scored two good hits and the bad guy stayed on his feet long enough to get to me with a large knife before collapsing (he lived, and is now a guest of the State). You want a round that will STOP your assailant NOW, and keep him there, living or not, and that's why I prefer the larger rounds.
The Walther P99 you're looking at is comes in a compact and full sized model, the compact being a 9mm, while the full-sized comes in 9mm, .40 and .45 cals. The Beretta Px4 "Storm" comes in both a full and sub-compact model, the sub coming in either 9mm or .40 cal, while the full-sized comes in 9mm,
.40 and .45. Both have rails in case you're into goodies like mini-flashlights or laser sights.
But as Dillinger and others say, get to a gun shop, preferably one that has an indoor range. Mine has a good assortment that they will let you shoot, that's probably why they sell so many. Find something that first FEELS GOOD in your grip. If you can shoot it, all the better. Different weapons handle recoil better than others. If you can't shoot it, find a gun club. Guys (and Gals) will have a whole assortment of different weapons you can shoot. Enthusiasts just LOVE to show off their weapons. If you were in SW Ohio, I'd bring everything I have to the range and let you shoot it.
Watch the Forums, and heed some advice.
BTW, of the two weapons you listed, I'd grab the Beretta. I've fired my buddie's P99 and love it. Plus, a big plus, it has a thumb safety, something any 1911 shooter loves. I've also fired the Walther, not the Px4, and found it a good weapon. But of the two, the Beretta gets not only my vote, but the Military and S.O.C.O.M. It's rugged to the point of being almost bulletproof.