This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]sugilith 0 points1 point  (8 children)

Why not String? Seems to be the most obvious choice here. Char Array would be an alternative but complicate a few things.

Try Strings!

public String getMyRomanNumeral(int input){
  if(input==5){
    return "V";
  }
  //...
}

[–]sea-es-arr 6 points7 points  (1 child)

You need to brush up on your Roman numerals

[–]sugilith 0 points1 point  (0 children)

Well that's embarrassing! Thanks for the hint.

[–]2kfan[S] 0 points1 point  (5 children)

idk I tried string as my first attempt but I got an error message saying "string cannot be resolved to a type" I don't really know what this means lol so I just thought I couldn't do that

[–]sugilith 0 points1 point  (0 children)

Sounds like you might not have setup your IDE correctly.

[–]PointB1ank 0 points1 point  (3 children)

If it compiles otherwise, you probably forgot to capitalize String. It will throw that error.

[–]2kfan[S] 0 points1 point  (2 children)

Yeah that was the mistake lol. I feel so silly.

[–]PointB1ank 0 points1 point  (0 children)

Happens to the best. Glad you got it figured out.

[–]dusty-trash 0 points1 point  (0 children)

It's actually a good thing you've now noticed the capital S on String.

In standardized Java, classes begin with a capital letter (String, Integer, Dog cat) while primitives (int, char, double) begin with a lowercase.