If the Sun were made of bananas, it would be just as hotAs I said above, this has a nugget of truth, i.e., massive objects will compress themselves and increase in temperature. There is no doubt about this, indeed much of the Earth's heat is left over from it coalescing and the residual effects. However, it ignored the fact that the heat would quickly (in astronomical time scales) dissipate and the object would cool down. Nuclear fusion is what sustains a star's heat for billions of years.
The Sun is hot, as the more astute of you will have noticed. It is hot because its enormous weight – about a billion billion billion tons – creates vast gravity, putting its core under colossal pressure. Just as a bicycle pump gets warm when you pump it, the pressure increases the temperature. Enormous pressure leads to enormous temperature.
If, instead of hydrogen, you got a billion billion billion tons of bananas and hung it in space, it would create just as much pressure, and therefore just as high a temperature. So it would make very little difference to the heat whether you made the Sun out of hydrogen, or bananas, or patio furniture.
Luckily my fellow pedantic internet nerds corrected this oversight and the following was added:
Edit: this might be a little confusing. The heat caused by the internal pressure would be similar to that of our Sun. However, if it's not made of hydrogen, the fusion reaction that keeps it going wouldn't get under way: so a banana Sun would rapidly cool down from its initial heat rather than burning for billions of years. Thanks to people who pointed this out.That being said, I felt the desire to go one step further in my pedantry. I knew bananas are mostly water, which is mostly hydrogen. I wondered if the sun would be able to undergo fusion if it were made out of bananas.
While the banana sun would likely be rather bright today, and still qualify as a star, it is unlikely that it would have given off enough heat for life to form on Earth. I suppose you should thank your lucky stars that a sea of free electrons and protons will form hydrogen atoms and not bananas (well at least not for a very long time).
As an epilogue I'll answer how many bananas one would need to equal the Sun's mass. Google tells us that a single banana is 125 grams, and Google's wonderful calculator makes short work of the calculation: