Java Java Data Structures Getting There Type Casting

Henrik Granstroem
Henrik Granstroem
3,127 Points

[ ] doesnt work in my workspace

I'm doing the course of Data Structure, and I'm suppose to write this array line in java-repl. But I can't type [ ]. When I type Alt Gr + 8, it should make the character, but it deletes the chracter to the left instead and when I type Alt Gr + 9 it should make the other one of the brackets, but nothing happens. Some bugs in the workspace function?

Jasper Peijer
Jasper Peijer
45,009 Points

Using an English UK keyboard should work. Then you can just use the key for the curly braces without pressing shift.

4 Answers

Matthias Margot
Matthias Margot
7,236 Points

I had the same issue and like anders already said its due to the console in workspaces not reading certain commands on different keyboards other than the english one. This can also become a problem when you start working with IDE's (integrated development environments like atom.io, android studio or eclipse for example) since they have shortcuts that sometimes only work for certain keyboards (stuff like CTRL + C althought this does work on any keyboard). I'd recommend you make an effort to change to the english keyboard layout if you're serious about getting into coding since you will meet a couple of problems connected to not having the keyboard layout a certain software was designed to work with. It doesn't take too long to get used to it, let's say 1-2 weeks tops and til then you can have a picture of the english keyboard printed out next to you so you can look where a certain sign is while you learn it (that's how i did it at least).

Anders Björkland
Anders Björkland
7,480 Points

Hm. I don't know the solution to this one, but I had the same problem as you are having. It probably is because the repl is defaulting to an English keyboard layout. [] is at the place where (if you have a Swedish layout) you have å and ¨. See if that helps.

Henrik Granstroem
Henrik Granstroem
3,127 Points

Hi guys!

Yes, that makes sence! Problably it is that issue. I'm using Swedish layout, since I'm Swedish, lol.

Thanks for answers and sharing your experiances. :)

Ismail KOÇ
Ismail KOÇ
1,748 Points

http://www.alt-codes.net/ check this site and look at alternative way to write symbols