Skip to content

Instantly share code, notes, and snippets.

@minte9
Last active August 31, 2021 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minte9/6548f90f1f4e2362be3c475ec15810b0 to your computer and use it in GitHub Desktop.
Save minte9/6548f90f1f4e2362be3c475ec15810b0 to your computer and use it in GitHub Desktop.
/**
* Declare Number no as float 22.23 ...
* Use object's shortValue() method and ...
* Display no as 22
*/
class App {
public static void main(String[] args) {
/**
* SOLUTION
*/
Number no = new Float(22.23);
System.out.println(no.shortValue()); // 22
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment