I have a great doubt as to what this action is called and how it is administered in memory.
Inside the main() method I make these sentences or instructions.
public static void main(String[] args) {
int i = 0;
int j = new Random().nextInt(100); // As it is called this way of acting or as it is called.
}
I have clear that what it does is directly invoke the Random class constructor method, invoke the
nextInt
method and generate a random number that is stored inside theint j
variable but I don't know how to define this type of action and I don't know if it is correct to do this kind of instructions.I'm curious to know what this type of action is called.
Thank you for your attention.
P.D : Sorry .. I'm learning