Play audio slide show -- Keyboard shortcut: 'x'  Back to slide -- Keyboard shortcut: 'u'  next  next  Play sound for this slide -- Keyboard shortcut: 'y'  IoDemo3.java - Eksempler på anvendelse af input kommandoer fra klassen Keyboard.Lecture 3 - slide 35 : 39
Program 2

import cs1.Keyboard;

class IoDemo3 {

public static void main(String[] args){
  
  System.out.println("Keyboard Demo");

  int i; double d ; String s;

  System.out.print("Indlæs et heltal: ");
  i = Keyboard.readInt();

  System.out.print("Indlæs et reelt tal: ");
  d = Keyboard.readDouble();

  System.out.print("Indlæs en tekststreng: ");
  s = Keyboard.readString(); 

  System.out.print("i = " + i + ". ");
  System.out.print("d = " + d + ". ");
  System.out.print("s = " + s + ". ");

  }

}