-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPrint.java
More file actions
31 lines (24 loc) · 915 Bytes
/
Print.java
File metadata and controls
31 lines (24 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Exemples de <pre>System.out.print()</pre><p>
* Les notes détaillées sont dans le manuel du cours
* @author physcrowley (2022-10)
*/
public class Print {
public static void main(String[] args) {
// mots
System.out.print( "Mon " );
System.out.print( "nom " );
System.out.print( "est " );
System.out.print( "Jean." );
System.out.println(); // retour de ligne
System.out.print( "Deux\nlignes\n" );
System.out.print( "\n" ); // ligne vide avec print
System.out.print( "En-tête\n" );
System.out.println( "\t- item 1");
System.out.println( "\t- item 2");
System.out.println(); // ligne vide avec println
// compléter une ligne d'affichage avec println
System.out.print( "Le résultat de 3 * 4 est ");
System.out.println( 3 * 4 ); // s'affiche à la fin du print
}
}