Play audio slide show -- Keyboard shortcut: 'x'  Lecture overview -- Keyboard shortcut: 'u'  Previous page: Input output og programstrukturering [Section] -- Keyboard shortcut: 'p'  Next page: Input i Java -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home  Play sound for this slide -- Keyboard shortcut: 'y'    De ikke objekt-orienterede dele af Java - slide 34 : 39

Output i Java 

Output besørges ved at kalde print eller printlnout i System klassen
 

 

class IoDemo1 {

public static void main(String[] args){

  int i = 1; double d = 1.1 ; boolean b = true ; char c = 'a'; 

  System.out.println("En streng");
  System.out.print("i = " + i + ". ");
  System.out.print("d = " + d + ". ");
  System.out.print("b = " + b + ". ");
  System.out.print("c = " + c + ". "); 
  }

}