Input: N = 5 Output:  Input: N = GeeksForGeeks Output: [GeeksForGeeks]
- Get the value N
- Create an array with this value N
- Create a List with this array as an argument in the constructor
Below is the implementation of the above approach:
List with element 1024:  List with element GeeksForGeeks: [GeeksForGeeks]
- Initialize a list in a single line with a specified value
- Initialize an ArrayList in Java
- How to Fill (initialize at once) an Array in Java?
- Java Program to Split an Array from Specified Position
- How to Convert a String value to Float value in Java with Examples
- How to Convert a String value to Byte value in Java with Examples
- How to Convert a String value to Short value in Java with Examples
- How to Convert a Byte value to String value in Java with Examples
- How to Convert a Double value to String value in Java with Examples
- How to Convert a Short value to String value in Java with Examples
- How to Convert a Float value to String value in Java with Examples
- Java Applet | Draw a line using drawLine() method
- Program to convert List of Integer to List of String in Java
- Program to convert List of String to List of Integer in Java
- JavaFX | Line with examples
- How to get the value of System Property and Environment Variable in Java?
- Evaluate the Value of an Arithmetic Expression in Reverse Polish Notation in Java
- Java Program to Create an Object for Class and Assign Value in the Object Using Constructor
- Java Program to Print the ASCII Value
- Swapping items of a list in Java : Collections.swap() with Example
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.