So i just started learning java in treehouse.com ive done the basics but when i try everything ive learnt there on the intellij idea ide nothing works.
I've already searched the internet trying to find a solution and I still cant find it, yea I've tried system.out but ive seen other people do it with just typing console too and if I try system.out on readline it doesnt work im literally confused.
I'm used to using the
String name=console.readln("whats yo name: ");
public class Main
public static void main(String args)
Console console = new Console()
This code won't work on IntelliJ.
To take input in an IDE use the following code.
Scanner sc = new Scanner(System.in) String in = sc.nextLine(); System.out.println(in);
You can also use the older way,
BufferedReader br = new BufferedReader(new InputStreamReader(System.in))); String in = br.readLine();