The Scanner class is used to get user input, and it is found in the java.util package. To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation. Program:- Output Screenshot:-
Tag Archives: java program
Array basics in java
Array:- An array is a collection of similar data elements stored at contiguous memory locations. It is the simplest data structure where each data element can be accessed directly by only using its index number. Reference:–(https://www.mygreatlearning.com/blog/what-is-an-array-learn-more-in-one-read/) Sample Program:- Print the number where the state placed Output Screenshot:- Program2:- Print the values in the array bracesContinue reading “Array basics in java”