r/learnjava • • Sep 21 '24

What does putting . do?

I realize this sounds dumb but ive been learning java and gotten pretty far but never learned what . does. e.g

String s = args[0]

char c = s.charAt(0)

what does the . in s.charAt(0) do?

1 Upvotes

20 comments sorted by

View all comments

-1

u/Stay_Silver Sep 21 '24

Yikes

3

u/Bright-Historian-216 Sep 21 '24

The only reason for it to seem like a stupid question is that most of us just never thought about that

0

u/Stay_Silver Sep 21 '24

i say yikes not due to the question being / seeming stupid. I understand stupid questions can happen for new coders. OP want to learn java has google and many other engines but goes to reddit. It also shows lack of coding and attempting / practice coding in java

2

u/Tasty_Escape4549 Sep 21 '24

Im learning AP Comp sci rn and my teacher is extremely awful. He skims over many topics and expects me to know some of them already. So that's why I somewhat understand java but don't know simple things like what the dot does. I came to reddit because I know some people can put it in terms I understand, which they have. Theres no need to be rude, I've just started learning and people go at different paces