Print Random number for java program
import java.util.Random; public class Program {
public static void main(String[] args) {
Random na = new Random();
System.out.println("Random no:- ");
int a = na.nextInt();
System.out.println(a);
}
}
// note // Rang of Random no. ( -2^31 to 2^31-1 )
// note // Random is a Non Static Class .
0 comments:
Post a Comment