Implicit type casting in java

Code examples

0
0

implicit type casting in java

// Implicit casting is the art of casting one variable type to another one.
// For example:
short x = 1
int y = x
// You now casted a short variable to an integer variable.
// This can also be done from a string to an integer, by using Integer.parseInt()
// So it can be done like this:

convertThis = "50";
convertedString = Integer.parseInt(convertThis);
// Now you converted a string to an integer.
// Happy coding!

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................