+ 1

Can anybody help me with this?

import java.util.Scanner; class Robot { int id; Robot(int i, String task) { id = i; Brain b = new Brain(); b.doTask(task); } private class Brain { public void doTask(String myTask) { if (myTask == think) { System.out.println(id + " is thinking..."); } } } } public class Program { Scanner sc = new Scanner(System.in); int cID = sc.nextInt; String cTASK = sc.nextString; public static void main(String[] args) { Robot r = new Robot(cID, cTASK); } } I don't get the errors, something about missing symbols and non-static variables.

1st Apr 2023, 1:45 PM
Teddy
Teddy - avatar
3 Answers
+ 8
Teddy there are some mistakes, I solved it and see your mistake check it what you have done try to understand then copy it https://code.sololearn.com/cM683499FJiU/?ref=app
1st Apr 2023, 1:56 PM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 3
Emerson Prado Ok Sir, I keep in mind.
3rd Apr 2023, 7:17 AM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 2
Sakshi Pls avoid giving finished code as answer, because it makes the OP skip the most important part of learning. Instead, prefer giving hints for the OP to find the solution.
3rd Apr 2023, 1:11 AM
Emerson Prado
Emerson Prado - avatar