Java - Programming Language
This course covers the basics of programming in Java. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Building A Mad Libs Game

Lesson 11
Author : Mike Dane
Last Updated : October, 2017


Code

Copy// import java.util.Scanner;
Scanner keyboardInput = new Scanner(System.in);

System.out.print("Enter color: ");
String color = keyboardInput.nextLine();

System.out.print("Enter plural noun: ");
String pluralNoun = keyboardInput.nextLine();

System.out.print("Enter celebrity: ");
String celebrity = keyboardInput.nextLine();

System.out.println("Roses are " + color);
System.out.println(pluralNoun + " are blue");
System.out.println("I love " + celebrity);