1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

<identifier> expected error

Discussion in 'Java' started by camzgon121, Mar 10, 2008.

  1. camzgon121

    camzgon121 New Member

    Joined:
    Mar 10, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi guys, I have this code and when I try to compile and run it gives me an <identifier> expected error.

    The code with the irrelevant parts taken out.

    Code:
    
    package ACCOUNT;
    
    import java.util.Scanner;
    import java.util.GregorianCalendar;
    import javax.swing.*;
    
    class Bank{
    
    static private double bal;   //Account balance
    static int withdraw;      //amount of times withdrawn 
    
    static void setBal(double amount){bal = amount;}
    static double getBal(){return bal;}
    
    public static void main(String[] args){
    //code
    }
    
    class Charge extends Bank{
      
    double fee = Bank.withdraw * 0.10;
    double tempbal = Bank.getBal();
    double amount = tempbal - fee ;
    Bank.setBal(amount);
        }
    
    when I run it points to the line Bank.setBal(amount) and says <identifier> expected

    can someone help?
     

Share This Page