I was preparing for scala exam and facing this issue

  Kiến thức lập trình

I am doing in scala eclipse, I dont have any issue until ArrayBuffer topic

Im doing ArrayBuffer topic, Can someone explain why i am getting this error, If possible i want to know the solution in ScalaEclipse.

import scala.collection.mutable.ArrayBuffer;

object ArrayBuffer {
  def main(args: Array[String]){
    
    var ArrayBuffer1 = ArrayBuffer(1,2,3,4,5)
    ArrayBuffer1.foreach(println)
    
  }
}

getting error

ArrayBuffer does not take this parameter in line

 var ArrayBuffer1 = ArrayBuffer(1,2,3,4,5)

New contributor

Koushik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT