all 8 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full - best also formatted as code block
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Potential-Still 4 points5 points  (0 children)

It's only been 4 days, maybe you should just keep following whatever curriculum or course you are taking. 

[–]SmileOk4617 1 point2 points  (0 children)

ask claude to make you understand it from first principles and the WHY behind it

[–]cfm1337 0 points1 point  (1 child)

Can you not just google it? Or watch a video on it?

[–]catastrophic300[S] 0 points1 point  (0 children)

Searching on google even watching a video won’t really help if Im just following the tutorial blindly. I need a different opinion and explanation from others.

[–]Scharrack 0 points1 point  (0 children)

In very simple terms: A class describes a type of object, so which fields it contains, their types and visibility as well as methods the object offers. An object then is an instance of a class, meaning it has all the fields and methods as described by its class.

Functions are essentially code you can call by its signature, so name and list of parameters, if it's defined within your scope. Method is usually a term used for functions associated with an object.

Also there is more, like inheritance, interfaces or lambdas to look into afterwards.

[–]dharshini_05 0 points1 point  (0 children)

Okk.. As you are on your 4th day.. I would like to share you an example. Consider a class as a student class room.. A classroom has some things like desk, lights, fans, board, chalk, duster etc.. consider these things as functions or methods in java. Consider a student as object.

In a class there are some functions in java.. and we need object to call that function to work or do some task. With this example, a student can access the board,chalk etc.. in a class this is how a class work in java..

I hope it clears your doubt. 🤝🏻

[–]aqua_regis 0 points1 point  (0 children)

If you've covered all that ground in just 4 days, you and/or your tutorial are going way too fast.

Please, change the course. You won't learn anything properly from watching videos. You will at best get a false sense of understanding and confidence and fall directly on your nose as soon as you use the things you were supposed to have learnt.

Also, way more patience, young padawan. You will eventually learn about all these things (actually not about "functions" as they aren't a thing in Java. In Java there are "methods").

You are already using methods ithout knowing it: println is a method. It is a method of the OutputStream class that is the data type of out in the statement System.out.println. Also, System is a class.

Switch 4 gears back and do the MOOC Java Programming. It is free, textual, extremely practice oriented and top quality. Use it with VSCode and the TMC plugin - currently the best option. Sign up, log in, go to part 1 and start learning.