• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Console c = System.console();

 
shivang sarawagi
Ranch Hand
Posts: 157
  • 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
Pie
Posts: 64717
86
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