Expand|Select|Wrap|Line Numbers
- import java.io.*;
- class CAcc
- {
- String name[]=new String[15];
- long accno;
- char type;
- double Bal;
- CAcc(String Name,long Accno,char Type,double bal)
- {
- name=Name;
- accno=Accno;
- type=Type;
- Bal=bal;
- System.out.println("New account created with provided details");
- }
- void deposit(double amnt)
- {
- Bal=Bal+amnt;
- System.out.println("Amount deposited in Bank is"+amnt);
- }
- int withdraw(double amnt)
- {
- System.out.println("Old Balance in account is Rs."+Bal);
- if(Bal>=amnt)
- {
- Bal=Bal-amnt;
- System.out.println("New Balance in account is Rs."+Bal);
- return(0);
- }
- else
- {
- return(1);
- }
- }
- void Check()
- {
- System.out.println("The Balance in Accno."+accno);
- System.out.println("The Balance is"+Bal);
- }
- }
- class Bank
- {
- public static void main(String []args)
- {
- CAcc Manish= new CAcc ("Manish","200","S","15000.00");
- Manish.Check();
- Manish.deposit(3000.00);
- Manish.withdraw(1500.00);
- Manish.Check();
- }
- }
- My CODE is this and the error is here
- Bank.java:22: incompatible types
- found : java.lang.String
- required:java.long.string[]
- name=Name
- ^
- Bank.java:58:cannot resolve symbol
- symbol: constructor CAcc(java.lang.String,Java.lang.string,java.lang.string,java.lang.String)
- location: class CAcc
- CAcc Manish=new CAcc("Manish","200","S","15000.00");
- ^