Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Console c = System.console();  RSS feed

 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


can anyone explain the logic of this line, we generally used
for example



which creates an object on the heap and assigns it to the reference a, but i don't understand
what is happening in the below line



why can't we say Console c= new Console();
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the javadoc for the System.console() method?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!