From Minecraft Wiki
Farming refers to the systematic production of Renewable resource. It is usually used to get Blocks, Food, Experience and more things. Specific types of farming include:
 Mob Farming
- Using wheat, seeds, and carrots to breed animals, to be slaughtered for their products or used in Egg, Milk, or Wool Farming.
- Creating spawn rooms for hostile mobs, to be killed for their drops.
- Farming Villagers by creating houses, doors, or curing spawned Villager Zombies.
 Experience Farming
- Waiting at an active monster spawner for monsters to spawn. This includes mobs that do not spawn naturally without the use of spawners, notably Cave Spiders.
- Covering the dimension of The End in half-slabs except a small area to allow Endermen to spawn. It is recommended that you defeat the Enderdragon first, making the task permanent and allowing you a way out. Surround the area that endermen will spawn in end stone except a 1 block area at the feet so they can be killed. It goes best with an enchanting room with 15 bookcases for level 30 enchantments.
 Food Farming
- Farming wheat, carrots, and potatoes, the three staple food crops. (Combined version of their original pages.)
Pumpkin and Melon Farming
- Farming pumpkins and melons.
 Block Farming
- Farming cacti for cactus green dye or traps.
- Creating a stone or cobblestone generator for self-repairing shelters or harvesting.
- Creating an Obsidian generator for Obsidian intensive builds.
- Farming ice using a self-refilling rink.
- Farming pumpkins for use in pumpkin pie, Jack 'o' Lanterns or Golems.
- Farming vines for use instead of ladders, for decoration or to be used to craft mossy stone brick or moss stone.
- Farming Trees for wood, saplings, apples, or charcoal.
 Item Farming
- Farming iron ingots by killing the Iron Golems spawned in large Villages.
- Farming gold nuggets by killing the Zombie Pigmen which spawn in The Nether or near Nether Portals in The Overworld.
Chicken Egg Farming
- Farming eggs for use in cake, pumpkin pie or creating chickens.
Cocoa Bean Farming
- Farming cocoa beans for use in cookies or creating brown wool.
- Farming mushrooms for use in mushroom stew or creating huge mushrooms.
Nether Wart Farming
- Farming Nether Wart for use in Brewing.
- Trapping a Snow Golem and digging the snow it produces.
Sugar Cane Farming
- Farming sugar cane for books and sugar, which is required for cake and pumpkin pie.