Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Created September 12, 2023 13:15
Show Gist options
  • Select an option

  • Save nherbaut/06a437d879687d4d585979fcc94ec4da to your computer and use it in GitHub Desktop.

Select an option

Save nherbaut/06a437d879687d4d585979fcc94ec4da to your computer and use it in GitHub Desktop.
L2.1.7 Les conditions.2

Donnez la valeur de retour de h avant d'exécuter le code

public class TypesL2 {
static int f(int x) {
return x * 2 - 1;
}
static int h() {
int a = 3;
int b = f(a) + f(4);
return b;
}
public static void main(String... args) {
int returnValue = h();
System.out.println(returnValue);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment