Answer:
import java.util.Scanner;
public class DashLine {
public static void main(String[] args) {
// Declaring variables
int n;
/*
* Creating an Scanner class object which is used to get the inputs
* entered by the user
*/
Scanner sc = new Scanner(System.in);
// Getting the input entered by the user
System.out.print("Enter a number :");
n = sc.nextInt();
// calling the method by passing the user entered input as argument
dashedLine(n);
}
//This method will print the dashed line for number greater than zer
private static void dashedLine(int n) {
if (n > 0) {
for (int i = 1; i <= n; i++) {
System.out.print("-");
}
System.out.println();
}
}
}
Explanation:
Answer:
session state
Explanation:
Session state in the context of NET is a method keep track of a user session. Session states allow a developer to store data about a user as he or she navigates through ASP.NET web pages.