The 18" guns of the Yamato, and her sister ship (do the Japanese refer to their ships as she?) the musashi, were the largest guns ever to be fitted to a ship. They were also the largest and heavist battle ships ever built.
It is believed that the loss of these two huge and powerful ships to aircraft is what turned the tide fully to the ships we have to day.
In total 5 ships were supposed to be built. The third hull, Shinano, was changed in to an aircraft carrier. The fourth hull was abandoned when only half complete and the fifth keel was never laid.
There were plans for bigger ships to be built with 20" guns but they were never built.
The whole point of the Yamato was to outclass every battle ship the Americans had. Most of the American ships came through the Panama canal their size was limited, this is why the Americans only ever had 16" guns, they simply couldn’t fit more armour or bigger weapons to the ships as it would make them to big to go through the canal thus they would have to go around South America to reach the Pacific.
But as I said above, they didn’t count on air power, in a straight forward battle, such as Hood and Bismark, it highly likely that a Yamato class ship would tear apart any American ship or maybe even a pair. But the Japanese air defence capabilities on board were sorly lacking.
The idea of using the ships main armourment was flawed from the begining.
In trials it was shown as effective and quite devestating to aircraft, where the aircrafts flight path could be predicted and the guns positioned. In practice the guns had to be traversed to engage the aircraft which were manouvring to avoid fire, they were too slow moving for this. The speed of reloading was also slow, as each gun had to return to almost horizontal (as many did at this time in all Navies) for the next round to be loaded.