V
V
Vladislav Kadun2018-10-28 14:06:08
Kotlin
Vladislav Kadun, 2018-10-28 14:06:08

What causes "Expecting a top level declaration"?

My code:

1 package ru.kek;
2 
3 class Program {
4
5  fun main(args: Array<String>) {
6  	println("Hello, world!");
7  	}
8
9 }

I don't know what could be wrong with this helloworld. Swears on line 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Kadun, 2018-10-28
@ZXZs

Solved the problem: package is superfluous here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question