Question: How to convert String to LinkedList?? String with numbers only. How do i create the two constructor methods LinkedListInteger(final String number){} & LinkedListInteger(final int number){}

How to convert String to LinkedList??

String with numbers only.

How do i create the two constructor methods LinkedListInteger(final String number){} & LinkedListInteger(final int number){} ??

How to convert String to LinkedList?? String with numbers only. How do

class LinkedListInteger{ private List listNumber; private Boolean isNegative; public LinkedListInteger() { listNumber = new LinkedList(); isNegative = null; } public LinkedListInteger(final String number) { //converts the given string number into a LinkedListInteger /egative number is possible 1/ex: input to constructor is "543" // listNumber should be 5 -> 4 -> 3 -> null with isNegative set to false 1/ex: input to constructor is "-543" // listNumber should be 5 -> 4 -> 3 -> null with isNegative set to true } public LinkedListInteger(final int number) { //converts the given int number into a LinkedListInteger /egative number is possible //ex: input to constructor is 543 // listNumber should be 5 -> 4 -> 3 -> null with isNegative set to false 1/ex: input to constructor is -543 // listNumber should be 5 -> 4 -> 3 -> null with isNegative set to true }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!