Skip to content

Instantly share code, notes, and snippets.

@rmg007
Created October 3, 2022 21:37
Show Gist options
  • Select an option

  • Save rmg007/b8a23eb6a4f57002e269dc762658747a to your computer and use it in GitHub Desktop.

Select an option

Save rmg007/b8a23eb6a4f57002e269dc762658747a to your computer and use it in GitHub Desktop.
learn and dive deep into Java. Escape Sequences and printf lecture part 2
public class Main {
/*
My name is John
I live in france since 2023
My salary is 45.55555589
*/
public static void main(String[] args) {
String name = "John";
int year = 2023;
double salary = 23.4545666;
System.out.printf("My name is %s\nI live in france since %d\nMy salary is %.2f", name, year, salary);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment