1) read from output file
eg: 1222222 + 2333333
3444444 - 9999999
6666555 * 7

2) For addition and sutraction, Number1 and Number2 should be large integers and must be stored in a link list.
eg.output = 1222222 + 2333333 =

3) For multiplication, Number1 should be stored in a link list and the small integer in a variable.
output = 66666555 * 7 =

4) Write to output file

When I try to read from the output file, this error is generated
!!Error :Variable last might not have been initialize
Help me to clarify the issue becuase i don't think I have to initialize "last" as it has already been declared as a node type.


import java.util.*;

class Node{
	int bigInt;
	Node next;
        bigInt = 0;
		next = null;
	public Node(int bigInt){
		bigInt = 0;
		next = null;
public class BuildList{
	public static void main(String[] args)throws IOException{
	Scanner in = new Scanner(new FileReader("input.txt"));	
	FileWriter out = new FileWriter("output.txt") ;
	Node top, np, last;
	top = null;
	//Reading data from input.txt
	int bigInt = in.nextInt();
		if (bigInt > 100){//only bigInt numbers are added to the list for add, subtract and multiply
			np = new Node(bigInt);
		if (top==null){
			top = np;
		}else{ = np;
			last = np;
			bigInt = in.nextInt();
}//end main
}//end class check

Last edited by shabbir; 25Nov2007 at 11:16.. Reason: Code block