Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialayub ali
Courses Plus Student 723 Pointswhat is import java.io.console; do i have to start with that every time am writing a program
help please
2 Answers
Aayush Mitra
24,904 PointsHi ayub!
Java.io.console is a set of tools.
Java is a programming language and it has built in objects and methods that you can use.(If you have not learned about that yet you will soon. Just thing of it as tools to do things.)
Java has a lot of built in tools to use, with these, if you do a lot of coding, you can do cool things. For developers, to make these things, it would be very tedious to spend hours and hours of your time coding these things which are going to be just a small part of your program.
This is why there are files that have code to do some of these things. Since they have written this code for you, you can use it! That is why you import Java.io.console. Java.io.console comes with certain methods you can use. If you want to use them in your project, you can, just import them with that line of code.
Hope this helps!
Thanks!
Agapitus Iboro
Courses Plus Student 2,812 Points"what is import java.io.console" = its is a tool that helps with your code "do i have to start with that every time am writing a program" = no, because this is an import that is used when dealing with a console. when dealing with another issue you'll need a different import.