Need solution | Sololearn: Learn to code for FREE!

+1

Need solution

What are the error in that code? public class Program { public static void main(String[] args) { Teacher teacher1 = new Teacher(); teacher1.name = "Tommy"; teacher1.gender = "male"; teacher1.phone = 0987543; System.out.println("Name= "+teacher1.name); System.out.println("Gender = "+teacher1.gender); System.out.println("Phone = "+teacher1.phone); } }

8/18/2022 11:09:28 AM

Mustakim Rahman

9 Answers

New Answer

0

Thanks a lot brother #abpatrick_catkilltsoi But you know what ,there are some bugs also running at sololearn app. Developers also try hard enough to solve those. However, thanks for helping.

+3

Where is your teacher class?

+3

Create teacher class like this: class Teacher { public string name; public string gender; public int phone; }

0

brother i cannot understand. Can you explain?

0

Create teacher class like this: class Teacher { public string name; public string gender; public int phone; } I still cannot get any output. It shows some error.

0

OK, Oracle/Windows/Photoshop also has a lot of bug, so you are as good as them.

0

Brother i’m not joking. Cause in jdk or netbeans when you type "string" it autometically convert to "String". But in sololearn it doesn’t. It is all about capital (S) and small (s). That's the main thing. However ,thanks again for helping.

0

OK, ide will create class for you with AI automatically too, copilot or GPT4 will replace your job soon. May be…it would be better to learn household bug removal than dealing with the automatic capital bug.

0

You should your program instead of Teacher