☕
Java
CtrlK
  • Hello World
  • IntelliJ IDEA
  • if-else statement
  • arithmetic expression
  • primitive types
  • primitive type range
  • Type casting
  • Char
  • String
  • Operators
  • Array
  • Switch
  • Prime Number
  • Continue vs Break
  • Inputs
  • OOP
  • Inheritance
  • Composition
  • Encapsulation
  • Polymorphism
  • Override vs Overloading
  • Random
  • Array assign
  • ArrayList
  • data-structures
  • Interface
  • Inner class
  • Abstract
  • Resources
Powered by GitBook
On this page

Random

get random number from 1 to 5

int randomNumber = (int) (Math.random() * 5) + 1;
PreviousOverride vs OverloadingNextArray assign

Last updated 2 years ago