Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Created September 28, 2023 11:36
Show Gist options
  • Select an option

  • Save nherbaut/560867a7e6d72cc4c8340cdbc509c228 to your computer and use it in GitHub Desktop.

Select an option

Save nherbaut/560867a7e6d72cc4c8340cdbc509c228 to your computer and use it in GitHub Desktop.
L2.2.1 Les Types et les Objets

Commentez la déclaration des variables x et y, puis décommentez une autres déclaration. Quel est l'impact sur la compilation. Est-ce que l'opération + fonctionne sur

  • Les int?
  • Les String?
  • Les Points?
public class Code{
static class Point{
}
public static void main(String ...args){
int x=1;
int y=2;
//Point x=new Point();
//Point y=new Point();
//String x="Salut";
//String y=" Nousnous"
System.out.println(x+y);
}
}
@nherbaut
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment