-
-
Save uncoded-ro/5b3c5df038dccae27aba0b15cda0d255 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Casting { | |
public static void main(String[] args) { | |
// conversie implicita | |
double media; | |
int a = 43; | |
short b = 15; | |
media = (a + b) / 2; | |
System.out.println("Media = " + media); | |
// conversie explicita | |
char c = 'a'; | |
int d = 99; | |
System.out.println("Conversie de la char la int: " + (int) c); | |
System.out.println("Conversie tip de la int la char: " + (char) d); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment