0
Plz correcty mistakes here
package person; public class person { public static void main(String[] args) { string name; char sex; int sex; voidtellsex() { if (sex =='m') System.out.println("i am male"); else if (sex == 'f') System.out.println("i am female"); else System.out.ptintln("i dont know"); } void tellage () { if (age <10) System.out.println("i am just a kid."); else if (age < 20) System.out.println("i am a teenager"); else System.out.println("i am grown up"); } }
2 Respostas
+ 2
1) You must define all atrribute in class scope not in main function scope
2) You have two attribute with same name (sex)
3) it think that with voidtellsex you want void tellsex
4) Methods must be defined in class scope and not in main
+ 1
thank u krow