This site requires JavaScript, please enable it in your browser!
Greenfoot back
divinity
divinity wrote ...

2021/7/8

identifier expected

divinity divinity

2021/7/8

#
hey am trying to building bank, i have to get to run using the gui haven't quite finished as yet as I am trying to get the button, lables, checkbox to, right I am trying to code a male and female radio button and that is where my errors are;
1
2
3
4
5
6
7
8
9
public String getSelectedOption(){
        
       Enumeration<AbstractionButton> radbutts = group. here is where the error is: identified expected
       while(radbutts.hasMoreElements()){
           AbstractButton currentRadioButtons = radioButtons. and also here is the same error: identifier expect
       }
       return null;
   }
    what do they me and where can i find the identifiers
RcCookie RcCookie

2021/7/9

#
You need to end the statements with semicolons, not with dots. If you write „.“ Java expects you to try and access a field or method of that object, which starts with a name, an identifier. Also to make your code and question nord. clear please format any text that is not actual code as comment („//“).
divinity divinity

2021/7/12

#
hi RcCookie it is end with a semi-colon but here is the is the code one more time
1
2
3
4
5
6
7
8
Enumeration<AbstractionButton> radbutts = newgrp.getElements();  ( u see the semi-colon) the error is here this line
while(radbutts.hasMoreElements()){
    AbstractButton currentRadioButtons = radbutts.nextElement();     and this line aslo
    if(currentRadioButtons.isSelected()){
        return currentRadioButtons.getText();
    }
}
return null;
this is the error: incompatible types: Enumeration<AbstractButton> cannot be converted to Enumeration<AbstractionButton> ----
danpost danpost

2021/7/13

#
Use "<AbstractButton>" in line 1 (instead of what you put).
You need to login to post a reply.