Not able to upload codes

I’m a newbie to challenges section and facing problem in uploading codes here.
the code is working on my eclipse ide but not here.
The error it always shows is as below:-

Output : Compile_error

Compiling failed with exitcode 1, compiler output:
prog.cpp:1:1: error: ‘package’ does not name a type
package patterns;
^~~~~~~
prog.cpp:3:1: error: ‘import’ does not name a type; did you mean ‘short’?
import java.util.Scanner;
^~~~~~
short
prog.cpp:10:1: error: expected unqualified-id before ‘public’
public class MnmhnLovePttrn1 {
^~~~~~

There is an option for language selection where you write your code in hackerblocks. You are not selecting java language . Select java then write code . Error is because you are writing code in java and compiler running is for c++.

1 Like