Answer:
Answer is in the attached screenshot.
Explanation:
Using regex to split a given input string via whitespace, then returns the first and last element of the array.
III is correct .... esc code use \
You're probably looking for DHCP (Dynamic Host Configuration Protocol).
Answer:
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader brObject = new BufferedReader(new InputStreamReader(System.in));
String str;
while ((str = brObject.readLine()) != null) {
int number = Integer.parseInt(str);
System.out.println(number * number);
}
}
}
Explanation:
- Inside the main method, create an object of BufferedReader class to read lines from standard input.
- Declare a string and run a while loop until it reaches the end of the input.
- Inside the while loop convert the string into an integer data type.
- Finally display the output by squaring the number.