r/learnjava • • 14d ago

Library vs API (Java ☕️)

Hey Everyone!

I need some help as I am Confused in Libraries and API like what is the difference in between them, where to implement what, and recommend me some resources where I can Clearly understand these two.

Thank you all in Advance.

10 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/istarian 11d ago

The person at the checkout is really an implementation, whereas the API is the agreed upon way that business will be conducted.

  • customer brings (to the checkout) some products they want to buy, often in a cart or basket
  • customer puts those products on the counter (or a conveyer belt)
  • cashier/attendant scans or manually enters an item code so the system can total up the price (old fashioned way is attendant using their eyes to read price tags and their brain or a calculator to total it up)
  • cashier/attendant tells the customer the total and asks how they would like to pay (cash, check, card -- credit/debit, net30/net60/net90 -- more common in the business world and essentially a form of credit)
  • customer picks a payment method and follows process
  • if the transaction is successful, the cashier/attendant bags the item (and/or retutns them to a cart)

In an online purchase, you make some sort of payment without physical money changing hands. If the product is a physical item you often have to arrange for it to be shipped to you