Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing inputstream to a sub class?  RSS feed

 
Brian Ngo
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have 6 classes that extends a abstract class, if i want user to input data in my main class using InputStreamReader.


How can i pass the String? Is it possible?
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand you correctly the code you have shown us is in a super class and you want to pass the string myString to a method in the subclass. Simple. You declare an abstract method in your super class that takes a String as an argument and you implement that method in the subclass.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!