What’s the Difference Between Preferred and Common Stock?

All stock is not created equal. Companies offer two main types of stock: common and preferred stock, each with its share of advantages and disadvantages for investors.

Common stock versus preferred stock
Common stock and preferred stock both represent some degree of ownership of a company. Holding shares of common stock gives you the opportunity to vote in the election of the board of directors. This is usually equivalent to one vote per share that you own. Owning preferred stock usually guarantees the payment of dividends but does not come with voting rights.

(more…)

Staircase

How to clear / delete the content of StringBuffer()

The StringBuffer is always been using for the String concatenation. However thisclass didn’t provide a method to clear the existing content. Why there are no clear() function?

You can use the delete(int start, int end) as dirty trick :
sb.delete(0, sb.length());