1) It doesnt work that way and, 2) your friend is stupid.
Even if you COULD get a loan from a financial institution, paying it back right away does absolutely no good and does not establish a credit history. The key word here is HISTORY. History refers to a period of time and, for the credit bureau, that period of time is generally 2 years. If you take out a loan, initially your credit score will fall a few points because your ratios (debt-to-income) have changed. After about a year of reliable and on-time payments, your score will start to slowly go up. But it isnt until after 2 years of reliable and on-time payments that the bureau considers you to have proven yourself financially responsible and, after that point, your score will rise markedly. Loans under 2 years are classified as "to new to establish credit worthiness". So, if you go get a loan and decide that you can just pay it back over a 2 year period, you will end up paying back several hundreds more than what you borrowed because your interest rate (as a first-time borrower) will be high. Aside from that, the temptation to spend that money on something else (rather than leave it alone and use it to repay the loan) is more than most people can bear. So, taking out a loan and repaying it shortly afterwards will not help you.....repaying it over 2 years will cost you. True it will build your credit, but it isnt the smartest way to do it.