For this Question: Two numbers are represented in Linked List such that each digit corresponds to a node in the linked list. Your task is to add these two numbers and return the sum in a linked list.

<b>Note:-</b> Linked list representation of a number is from left to right i.e if the number is 123 then in the linked list it is represented as 3->2->1<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>addNumber()</b> that takes head nodes of both the linked lists as parameters.

<b>Constraints:</b>
1 <=numbers<=10<sup>1000</sup>Return the head of modified linked list.Sample Input:-
1234 45643


Sample Output:-
46877, I have written this Solution Code:  static Node addNumber(Node first, Node second)  
{     Node res = null; // res is head node of the resultant list 
        Node prev = null; 
        Node temp = null; 
        int carry = 0, sum; 
  
        while (first != null || second != null) //while both lists exist 
        { 
            sum = carry + (first != null ? first.data : 0) 
                    + (second != null ? second.data : 0); 
  
            carry = (sum >= 10) ? 1 : 0; 
  
            sum = sum % 10; 
  
            temp = new Node(sum); 
  

            if (res == null) { 
                res = temp; 
            } else // If this is not the first node then connect it to the rest. 
            { 
                prev.next = temp; 
            } 
  
            prev = temp; 
  
            if (first != null) { 
                first = first.next; 
            } 
            if (second != null) { 
                second = second.next; 
            } 
        } 
  
        if (carry > 0) { 
            temp.next = new Node(carry); 
        } 
  
        // return head of the resultant list 
        return res; 
}  , In this Programming Language: Java, Now tell me if this Code is compilable or not?