120k views
0 votes
What is this N mean????? In java

What is this N mean????? In java-example-1

2 Answers

5 votes

import java.util.Scanner;

import edhesive.testing.Math;

public U2_L8_Activity_One{

public static void main(String[] args) {

Scanner myObj = new Scanner(System.in);

System.out.println("Enter a number.");

int n = myObj.nextInt();

for (int i = 0; i < 10; i++){

System.out.println((int) (Math.random()*n));

}

}

}

I hope this helps!

User Simon Sheehan
by
4.7k points
0 votes

Answer:

\\ is an escape character for strings that are replaced with the new line object. Writing \\ in a string that prints out will print out a new line instead of the \\. Java Escape Characters

Step-by-step explanation:

If that what you meant. But n most of the time is either a string character or no special meaning such as integer that you defined.

N can also mean null

User Marcin Malinowski
by
4.5k points