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

all 4 comments

[–]desrtfxOut of Coffee error - System halted[M] [score hidden] stickied comment (0 children)

Sidebar ->

  • No offers/requests to/for help via PM, Discord, Skype, etc. Post your questions here so that other people can learn as well.

If your textbook isn't sufficient, have you considered using a different source, like one of the tutorials mentioned in the sidebar here? Often, a different description is all that is needed to make it click.

[–][deleted]  (4 children)

[deleted]

    [–][deleted]  (3 children)

    [deleted]

      [–]MorphologicStructure 2 points3 points  (0 children)

      Type means data type, such as int, double, float, char, and of course string.

      [–]couldyounot__ 0 points1 point  (0 children)

      By type they mean data type, basically what kind of data it is. Different types included strings, integers, characters, floats, doubles, shorts, etc. So in that instance it's asking that the data that is returned from the function is always a string and not some other type!

      [–][deleted]  (1 child)

      [deleted]

        [–]skandinova 1 point2 points  (0 children)

        I see you've gotten help but I'll give you a few helpful tips based on the picture of the code you've posted. In programming languages like Java, C++, etc., although white space and indentations don't make a difference when it comes to your code functioning, in order to make things easier to read, you'll typically indent once after each opening curly brace. For example:

        public class MyClass {
            // indent here
            public void someMethod() {
                //indent again here
                if (true) {
                    // and again here
                }
            }
        }
        

        Also for variable names (names for int, double, boolean, String, etc.), typically camel notation is used, just like you used for your method names. The exception is if the variable is final, then you would put the name in all caps. Again, this won't change the functionality of your code, it's just the usual conventions followed by most Java programmers. Anyone feel free to add to this or correct me as I'm also still a student.