4 Replies - 1050 Views - Last Post: 21 February 2012 - 01:18 AM Rate Topic: -----

#1 gojabe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 09

Collections,Serialization,file updating & a lot of bugs.

Posted 17 February 2012 - 04:13 PM

I tried to create a simple(not using any sort of graphics,not using networking,neither using JDBC) banking system using J2SE but ended with a code with hell lot of bugs.

User.java


package Banking;
import java.util.*;
import java.io.*;
class User implements Serializable {
    String name;
    String address;
    String security_key;
    int age;
    boolean acc_locked;
    Calendar opened;
    Calendar last_interest_updated_on;
    double rate;
    double min_bal;
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> passbook;
    @SuppressWarnings("UseOfObsoleteCollectionType")
    public User()
    {
        name="";
        address="";
        security_key="";
        age=0;
        acc_locked=false;
        opened=Calendar.getInstance();
        last_interest_updated_on=Calendar.getInstance();
        rate=7.50;
        min_bal=1000.0;
        passbook=new Vector<day>();
    }
}



day.java

package Banking;
import java.util.*;
class day {
double withdrawl[];
double deposit[];
Date Withdral[];
Date Deposit[];
int witdrawl_pos;
int deposit_pos;
double curr_bal;
Calendar date;
public day()
{
    withdrawl=new double[5];
    deposit=new double[10];
    Withdral=new Date[5];
    Deposit=new Date[10];
    witdrawl_pos=0;
    deposit_pos=0;
    curr_bal=0.0;
    date=Calendar.getInstance();
}
}




manage_db

package Banking;
import java.io.*;
import java.util.*;
class manage_db {
    private String MONTH[]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
    @SuppressWarnings("UseOfObsoleteCollectionType")
    private void openAcc(User u,Integer pin,Integer valid) throws Exception
    {
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Hashtable<Integer,User> ht=new Hashtable<Integer,User>();
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    if(db.length()>0)
    {
    if(!pinExists(valid))
       return;
    FileInputStream fin=new FileInputStream(db);
    ObjectInputStream ois=new ObjectInputStream(fin);
    if(fin!=null)
    ht=(Hashtable<Integer, User>) ois.readObject();
    fin.close();
    ois.close();
    }
    FileOutputStream fout=new FileOutputStream(db);
    ObjectOutputStream oos=new ObjectOutputStream(fout);
    User t=new User();
    t=(User)ht.put(pin,u);
    oos.writeObject(ht); 
    fout.close();
    oos.close();
    }
    final void openAcc() throws Exception
    {
        User u=new User();
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        System.out.println("To open a new a/c you have to provide a valid user's authentication.");
        System.out.println("\nTo authenticate your reccommendation provide us da unique pin of any of our customer");
        int i=Integer.parseInt(br.readLine());
        System.out.println("Enter name ::");
        u.name=br.readLine();
        System.out.println("Enter your permanent address ::");
        u.address=br.readLine();
        System.out.println("Enter your secret authentication key(only to be known by you) ::");
        u.security_key=br.readLine();
        System.out.println("Enter your present age ::");
        u.age=Integer.parseInt(br.readLine());
        System.out.println("To open a new a/c you have to deposit atleast "+u.min_bal+" INR");
        boolean check=true;
        int t=0;
        Integer temp;
        if(i>0)
        {
        do
        {
            t=(int)(1000000*Math.random());
            temp=(Integer)i;
            check=pinExists(temp);
        }while(check);
        }
        else
            temp=(Integer)((int)(1000000*Math.random()));
        openAcc(u,temp,(Integer)i);
        System.out.println("Your unique pin is :"+t+"\n\nRemember this always");
        transaction d=new transaction();
        if(!d.deposit())
        {
            System.err.println("Sorry, Failed to create a new a/c");
            closeAcc(temp,u.security_key);
        }
        br.close();
    }
    @SuppressWarnings("UseOfObsoleteCollectionType")
 private double closeAcc(Integer pin,String key) throws Exception
 { 
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Hashtable ht=new Hashtable();
    double bal=-999.0;
    File f=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\counter.dat");
    FileInputStream fis=new FileInputStream(f);
        DataInputStream dis=new DataInputStream(fis);
    int i=dis.readInt();
    dis.close();
    fis.close();
    if(i>0)
    {
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    FileInputStream fin=new FileInputStream(db);
    FileOutputStream fout=new FileOutputStream(db);
    ObjectInputStream ois=new ObjectInputStream(fin);
    ht=(Hashtable<Integer, User>)ois.readObject();
    User u=(User) ht.get(pin);
    ois.close();
     if(u.acc_locked==true)
    {
        System.err.println("Your a/c has been locked from further use.");
        System.out.println("Deposit atleast"+(u.min_bal-u.passbook.lastElement().curr_bal)+" INR first");
        return -999;
    }
    if(u==null && u.security_key.equals(key))
        return -9999.0;
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> p_temp=u.passbook;
    calculate cal=new calculate();
    day lastElement=p_temp.lastElement();
    bal=lastElement.curr_bal+cal.calculateInterest(pin);
    ObjectOutputStream oos=new ObjectOutputStream(fout);
    u=(User)ht.remove(pin);
    oos.writeObject(ht);
    fin.close();
    fout.close();
    oos.close();
    }
    return bal;
 }
 final void closeAcc() throws Exception
 {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter pin ::");
    int p=Integer.parseInt(br.readLine());
    System.out.println("Enter your secret authentication key ::");
    String s=br.readLine();
    Integer pin=(Integer)p;
    double bal=closeAcc(pin,s);
    if(bal==-9999.0)
        return;
    if(bal<0.0)
    {
        System.out.println("Access denied!!!");
        return;
    }
    System.out.println("Thank you for using our banking services");
    System.out.println("Your current balance is ::"+bal);
    br.close();
 }
    @SuppressWarnings("UseOfObsoleteCollectionType")
 private User userInfo(Integer pin)throws Exception
 {
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Hashtable ht=new Hashtable();
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    FileInputStream fin=new FileInputStream(db);
    ObjectInputStream ois=new ObjectInputStream(fin);
    ht=(Hashtable<Integer, User>)ois.readObject();
    Object temp=ht.get(pin);
    User u=(User)temp;
    calculate cal=new calculate();
    u.passbook.lastElement().curr_bal+=cal.calculateInterest(pin);
    u.last_interest_updated_on=Calendar.getInstance();
    FileOutputStream fout=new FileOutputStream(db);
    User t = (User) ht.put(pin,u);
    ObjectOutputStream oos=new ObjectOutputStream(fout);
    oos.writeObject(ht);
    fin.close();
    fout.close();
    ois.close();
    oos.close();
    return u;
 }
 final void userInfo()throws Exception
 {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter pin ::");
    int p=Integer.parseInt(br.readLine());
    Integer pin=(Integer)p;
    User u=userInfo(pin);
    if(u==null)
    {
        System.out.println("Invalid pin!!!");
        return;
    }
    int present_age=(Calendar.YEAR)-(u.opened.get(Calendar.YEAR))+u.age;
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> v=u.passbook;
    day t=v.lastElement();
    if(u.acc_locked==true)
    System.err.println("YOU CANNOT PERFORM ANY WITHDRAWLS"
    +"\nYOUR A/C HAS MINIMUM BALANCE"        
    +"\n\nDeposit atleast "+(u.min_bal-t.curr_bal)+" INR to unlock your a/c");
    System.out.println();
    System.out.println("Name: "+u.name);
    System.out.println("Permanent address: "+u.address);
    System.out.println("Age: "+present_age);
    System.out.println("Account opened on: "+u.opened.toString());
    System.out.println("Current balance:"+t.curr_bal);
    System.out.println("Rate of interest"+u.rate);
    br.close();
 }
 final void displayPassbook()throws Exception
 {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter pin ::");
    int p=Integer.parseInt(br.readLine());
    Integer pin=(Integer)p;
    User u=userInfo(pin);
    if(u==null)
    {
        System.out.println("Invalid pin!!!");
        return;
    }
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> v=u.passbook;
    day t=v.lastElement();
    if(u.acc_locked==true)
    System.err.println("YOU CANNOT PERFORM ANY WITHDRAWLS"
    +"\nYOUR A/C HAS MINIMUM BALANCE"        
    +"\n\nDeposit atleast "+(u.min_bal-t.curr_bal)+" INR to unlock your a/c");
    System.out.println("\n\n");
    System.out.println("             ********************************************");
    System.out.println("             ****************PASS BOOK*******************");
    System.out.println("             ********************************************");
    System.out.println("\n\n");
    System.out.println("Date\tWithdrawls\tDeosits\tBalance\n\n");
    for(int i=0;i<v.size();i++)
    {
        t=v.get(i);
        double w=0.0,d=0.0;
        int j=0;
        while(j<t.deposit.length)
            d+=t.deposit[j];j=0;
        while(j<t.withdrawl.length)
            w+=t.withdrawl[j];
        System.out.print(MONTH[t.date.get(Calendar.MONTH)]+" "+t.date.get(Calendar.DAY_OF_MONTH)+" "+t.date.get(Calendar.YEAR));
        System.out.print("  "+w+"  "+d+"  "+t.curr_bal);
    }
    System.out.println("\n\n");
    System.out.println("             ********************************************");
    System.out.println("             ********************************************");
    System.out.println("             ********************************************");
    br.close();
 }
  final void displayDetailedPassbook()throws Exception
 {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter pin ::");
    int p=Integer.parseInt(br.readLine());
    Integer pin=(Integer)p;
    User u=userInfo(pin);
    if(u==null)
    {
        System.out.println("Invalid pin!!!");
        return;
    }
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> v=u.passbook;
    day t=v.lastElement();
    if(u.acc_locked==true)
    System.err.println("YOU CANNOT PERFORM ANY WITHDRAWLS"
    +"\nYOUR A/C HAS MINIMUM BALANCE"        
    +"\n\nDeposit atleast "+(u.min_bal-t.curr_bal)+" INR to unlock your a/c");
    System.out.println("\n\n");
    System.out.println("             ********************************************");
    System.out.println("             ****************PASS BOOK*******************");
    System.out.println("             ********************************************");
    System.out.println("\n\n");
    System.out.println("Date\tWithdrawls\tDeosits\tBalance\n\n");
    for(int i=0;i<v.size();i++)
    {
        t=v.get(i);
        int j=0,k=0;
        System.out.println("\n\n");
        System.out.println("             *******************PAGE "+i+"******************");
        System.out.println("\n\n");
        System.out.println("Deposit Time\tDeposit\tWithdrawl Time\tWithdral");
        while(j<=t.deposit_pos || k<=t.witdrawl_pos)
        {
            if(t.deposit_pos>=t.witdrawl_pos)
            {
            if(j<=t.deposit_pos)
                System.out.print(t.Deposit[j]+"  "+t.deposit[j++]);
            if(k<=t.witdrawl_pos)
                System.out.print(t.Withdral[k]+"  "+t.withdrawl[k++]);
            }
            else if(t.deposit_pos<t.witdrawl_pos)
            {
            if(j<=t.deposit_pos)
                System.out.print(t.Deposit[j]+"  "+t.deposit[j++]);
            if(j>t.deposit_pos)
                System.out.print("\t\t\t");
            if(k<=t.witdrawl_pos)
                System.out.print(t.Withdral[k]+"  "+t.withdrawl[k++]);
            }
                
        }
    }
    System.out.println("\n\n");
    System.out.println("             ********************************************");
    System.out.println("             ********************************************");
    System.out.println("             ********************************************");
    br.close();
 }
    @SuppressWarnings("UseOfObsoleteCollectionType")
 final boolean pinExists(Integer pin)throws Exception
 {
    boolean pin_exists=false;
        @SuppressWarnings("UseOfObsoleteCollectionType")
    Hashtable ht=new Hashtable();
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    FileInputStream fin=new FileInputStream(db);
    ObjectInputStream ois=new ObjectInputStream(fin);
    ht=(Hashtable<Integer, User>)ois.readObject();
    pin_exists=ht.contains(pin);
    fin.close();
    return pin_exists;
 }
}


transaction.java

package Banking;
import java.io.*;
import java.util.*;
class transaction {
    @SuppressWarnings("UseOfObsoleteCollectionType")
    private boolean deposit(Integer pin,double amt)throws Exception
    {
    boolean done=false;
    Hashtable ht=new Hashtable();
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    FileInputStream fin=new FileInputStream(db);
    ObjectInputStream ois=new ObjectInputStream(fin);
    ht=(Hashtable<Integer, User>)ois.readObject();
    User u= new User();
    Calendar c=Calendar.getInstance();
    Date today=new Date();
    if(u.passbook.isEmpty())
    {
        day d=new day();
        d.Deposit[d.deposit_pos]=today;
        d.deposit[d.deposit_pos++]=amt;
        d.curr_bal+=amt;
        u.passbook.add(d);
        return true;
    }
    else if(!u.passbook.lastElement().date.equals(c))
    {
        day d=new day();
        d.Deposit[d.deposit_pos]=today;
        d.deposit[d.deposit_pos++]=amt;
        d.curr_bal+=amt;
        u.passbook.add(d);
        return true;
    }
    Object temp=ht.get(pin);    
    u=(User)temp;
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> p=u.passbook;
    if(amt<u.min_bal && c.equals(u.opened))
        {
            System.err.println("Insufficient amount to open a new a/c!!!");
            return false;
        }
    if(!c.equals(u.passbook.lastElement().date))
    {
        day d=new day();
        d.date=Calendar.getInstance();
        d.deposit[d.deposit_pos]=amt;
        d.Withdral[d.deposit_pos++]=today;
        d.curr_bal=amt+(u.passbook.lastElement().curr_bal);
        u.passbook.addElement(d);
        done=true;
    }
    else
    {
        if(u.passbook.lastElement().deposit_pos<10)
        {
        u.passbook.lastElement().deposit[u.passbook.lastElement().deposit_pos]=amt;
        u.passbook.lastElement().Deposit[u.passbook.lastElement().deposit_pos++]=today;
        u.passbook.lastElement().curr_bal+=amt;
        done=true;
        }
        else
        {
            System.err.println("You have reached the maximum number of deposits per day!!!");
            return false;
        }
    }
    FileOutputStream fout=new FileOutputStream(db);
    User t=(User)ht.put(pin,u); 
    ObjectOutputStream oos=new ObjectOutputStream(fout);
    oos.writeObject(ht);
    fin.close();
    fout.close();
    return done;
    }
    final boolean deposit()throws Exception
    {
    boolean success=false;
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter pin ::");
    int p=Integer.parseInt(br.readLine());
    Integer pin=(Integer)p;
    System.out.println("Enter amount ::");
    double bal=Double.parseDouble(br.readLine());
    if(deposit(pin,bal))
        success=true;
    br.close();
    return success;
    }
    @SuppressWarnings("UseOfObsoleteCollectionType")
    private boolean withdrawl(Integer pin,double amt,String key)throws Exception
    {
    boolean done=false;
        @SuppressWarnings("UseOfObsoleteCollectionType")
    Hashtable ht=new Hashtable();
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    FileInputStream fin=new FileInputStream(db);
    ObjectInputStream ois=new ObjectInputStream(fin);
    ht=(Hashtable<Integer, User>)ois.readObject();
    Object temp=ht.get(pin);
    User u=(User)temp;
    if(u==null)
        return false;
    Calendar c=Calendar.getInstance();
    calculate cal=new calculate();
    Date today=new Date();
    if(u.passbook==null || u.passbook.lastElement().date.equals(c)==false)
    {
        day d=new day();
        d.Withdral[d.witdrawl_pos]=today;
        d.withdrawl[d.witdrawl_pos++]=amt;
        d.curr_bal-=amt;
        u.passbook.add(d);
    }
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> p=u.passbook;
    u.last_interest_updated_on=c;
    if(!u.security_key.equals(key))
    {
        System.err.println("Invalid authentication key!!!");
        return false;
    }
    u.passbook.lastElement().curr_bal+=cal.calculateInterest(pin);
    if(amt<u.passbook.lastElement().curr_bal)
    {
        System.out.println("Invalid amount for this transaction");
        return false;
    }
    if(u.acc_locked==true)
    {
        System.err.println("Your a/c has been locked from further use.");
        System.out.println("Deposit atleast"+(u.min_bal-u.passbook.lastElement().curr_bal)+" INR first");
        return false;
    }
    if(!c.equals(u.passbook.lastElement().date))
    {
        day d=new day();
        d.date=Calendar.getInstance();
        d.withdrawl[d.witdrawl_pos]=amt;
        d.Withdral[d.witdrawl_pos++]=today;
        d.curr_bal=amt-(u.passbook.lastElement().curr_bal);
        u.passbook.addElement(d);
        done=true;
    }
    else
    {
        if(u.passbook.lastElement().witdrawl_pos<5)
        {
        u.passbook.lastElement().withdrawl[u.passbook.lastElement().witdrawl_pos]=amt;
        u.passbook.lastElement().Withdral[u.passbook.lastElement().witdrawl_pos++]=today;
        u.passbook.lastElement().curr_bal-=amt;
        done=true;
        }
        else
            System.err.println("You have reached the maximum number of withdrawls per day!!!");
    }
    FileOutputStream fout=new FileOutputStream(db);
    User t=(User) ht.put(pin,u); 
    fin.close();
    fout.close();
    return done;
    }
    final boolean withdrawl()throws Exception
    {
    boolean success=false;
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter pin ::");
    int p=Integer.parseInt(br.readLine());
    Integer pin=(Integer)p;
    System.out.println("Enter your secret authentication key ::");
    String s=br.readLine();
    System.out.println("Enter amount ::");
    double bal=Double.parseDouble(br.readLine());
    if(withdrawl(pin,bal,s))
        success=true;
    br.close();
    return success;
    }
}


calculate.java

package Banking;
import java.io.*;
import java.util.*;
class calculate {
private double calculate_Interest(Integer pin)throws Exception
{
    double Int=0.0;
    Calendar today=Calendar.getInstance();
    int m1=0,m2=0,m3=0,y1=0,y2=0,y3=0;
        @SuppressWarnings("UseOfObsoleteCollectionType")
    Hashtable ht=new Hashtable();
    File db=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\database.dat");
    FileInputStream fin=new FileInputStream(db);
    Object temp=ht.get(pin);
    User u=(User)temp;
    if(u==null)
        return -999.0;
    else if(u.opened.equals(today))
        return 0.0;
    m1=u.last_interest_updated_on.get(Calendar.MONTH);m2=today.get(Calendar.MONTH);
    y1=u.last_interest_updated_on.get(Calendar.YEAR);y2=today.get(Calendar.YEAR);
    @SuppressWarnings("UseOfObsoleteCollectionType")
    Vector<day> p=u.passbook;
    int len=p.size();
    int pos=0;
    double pass[]=new double[12];
    double bf=0.0;
    if(len>0)
    do{
    while(m1<=Calendar.DECEMBER && pos<len)
    {
        day d=u.passbook.get(pos++);
        m3=d.date.get(Calendar.MONTH);
        if(m1==m3 && pass[m1]<d.curr_bal)
            pass[m1]=d.curr_bal;
        else if(m1<m3)
        {
            m1=m3;
            pass[m1]=d.curr_bal;
        }        
    }
    Int+=calculate_interest(pass,u.rate,bf);
    bf=u.passbook.get(pos-1).curr_bal+Int;
    for(int i=0;i<12;i++)
        pass[i]=0.0;
    m1=0;
    }while(y1<=y2);
    fin.close();
    return Int;
}
private double calculate_interest(double min[],double rate,double bf)
{
    double Int=0.0,fill=0.0,sum=bf;
    for(int i=0;i<min.length;i++)
    {
        if(min[i]>0.0)
            fill=0.0;
        else if(min[i]==0.0)
            min[i]=fill;
    }
    for(int i=0;i<min.length;i++)
    sum+=min[i];
    Int=(sum*rate*(1/12))/100;
    return Int;
}
final double calculateInterest(Integer pin)throws Exception
{
    double Int=calculate_Interest(pin);
    return Int;
}
}


User_interface.java

package Banking;
import java.io.*;
public class User_interface {
    public User_interface()throws Exception
    {
        execute();
    }
    private static void execute()throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        manage_db md=new manage_db();
        transaction t=new transaction();
        int i=0;
        System.out.println("             ********************************************");
        System.out.println("             **********WELCOME TO GOJABE'S BANK**********");
        System.out.println("             ********************************************");
        System.out.println("\n\n");
        System.out.println("Press 1 to open a new a/c ::");
        System.out.println("Press 2 to close a a/c ::");
        System.out.println("Press 3 to deposist money ::");
        System.out.println("Press 4 to withdraw money ::");
        System.out.println("Press 5 to view pass book of a particular a/c ::");
        System.out.println("Press 6 to view the detailed passbook of a particular a/c ::");
        System.out.println("Press 7 to view personal information of a particular a/c holder ::");
        System.out.println("Press 8 to logout ::");
        while(i!=8)
        {
        System.out.println("Enter your choice to proceed ::");
        i=Integer.parseInt(br.readLine());
        switch(i)
        {
            case 1:md.openAcc();
                break;
            case 2:md.closeAcc();
                break;
            case 3:if(t.deposit())
                System.out.println("Your a/c has been updated successfully");
                break;
            case 4:if(t.withdrawl())
                System.out.println("Your a/c has been updated successfully");;
                break;
            case 5:md.displayPassbook();
                break;
            case 6:md.displayDetailedPassbook();
                break;
            case 7:md.userInfo();
                break;
            default:System.out.println("You have entered a invalid choice");
        }
        }
    System.out.println("             ********************************************");
    System.out.println("             *****************LOGGING OUT****************");
    System.out.println("             ********************************************");
    System.out.println("\n\n");
    }
}



apply.java

package Banking;
import java.io.*;
public class apply {
    public static void main(String args[])throws Exception
    {
        int i=0;
        File f=new File("C:\\Users\\Souvik\\Documents\\NetBeansProjects\\Gojkid\\src\\Banking\\counter.dat");
        FileOutputStream fos=new FileOutputStream(f);
    DataOutputStream dos=new DataOutputStream(fos);
    dos.writeInt(i);
    }
}


And don't forget to create the two files database.dat & counter.dead

Is This A Good Question/Topic? 0
  • +

Replies To: Collections,Serialization,file updating & a lot of bugs.

#2 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: Collections,Serialization,file updating & a lot of bugs.

Posted 19 February 2012 - 09:58 AM

Indent my son, indent! It won't cause your RAM to melt!
Was This Post Helpful? 0
  • +
  • -

#3 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: Collections,Serialization,file updating & a lot of bugs.

Posted 19 February 2012 - 06:23 PM

Did your enter key break?

It doesn't matter how long the program is. Just because you can write it in one line doesn't mean you should.

This post has been edited by eker676: 19 February 2012 - 06:23 PM

Was This Post Helpful? 0
  • +
  • -

#4 gojabe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 09

Re: Collections,Serialization,file updating & a lot of bugs.

Posted 21 February 2012 - 01:11 AM

Sergio Tapia : Listen i have used indentation wisely,copy this code & place it in any standard IDE it will be be eye soothing then(to you). And then check out for possible bugs.
Was This Post Helpful? 0
  • +
  • -

#5 gojabe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-November 09

Re: Collections,Serialization,file updating & a lot of bugs.

Posted 21 February 2012 - 01:18 AM

eker676 : I didn't write it in a single line man. I wrote it out in the usual manner only, but the editor out here made that look like this. You copy this any & compile it & run it. The bugs are in the run-time.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1