+ 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.
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
+ 3
Emerson Prado Ok Sir, I keep in mind.
+ 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.