• +91 9723535972
  • info@interviewmaterial.com

Kotlin Interview Questions and Answers

Question - What are the names of some extension methods that Kotlin provides to java.io.File?

Answer -

Following are some extension methods that Kotlin provides to java.io.File:

  • bufferedReader(): It is used for reading the contents of a file into BufferedReader.
  • readBytes(): It is used for reading the contents of the file to ByteArray.
  • readText(): It is used for reading contents of the file to a single String.
  • forEachLine(): It is used for reading a file line by line in Kotlin.
  • readLines(): It is used for reading lines in the file to List.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners