English subtitles

← Our First Program - Intro to Java Programming

Get Embed Code
7 Languages

Showing Revision 8 created 05/25/2016 by Udacity Robot.

  1. You've just worked with Sarah on a few modifications of our first program, and
  2. I hope you found that you can make changes to the program without understanding
  3. all of the bits and pieces. But still, it's a good idea to have a closer look
  4. and know the lay of the land. First off, as I've said before, these two lines
  5. are pretty routine pronouncements that you have to do with every program. And
  6. most programmers don't think about it very much. You know, it's like when
  7. you're in an airplane and the flight attendant says we're about to leave put
  8. all your seats in your upright position, put the tray tables back. turn your
  9. cellphones off. And most people just don't even pay much attention to those
  10. things anymore. It's worth noting the word main here, that means it's the main
  11. entry point into the program. It's worth noting the name of the program here,
  12. and all the other things are kind of noise for us right now. Let's focus on the
  13. important statement. Text like this. That's enclosed in quotation marks is
  14. called a string. That's just a technical term for the text. This statement here
  15. prints the string, in the exercise with Sarah you've seen that one can also
  16. print numbers. If you put a number or a mathematical expression inside the
  17. parentheses and that gets printed. System.out over here is technically called
  18. an object. As you'll see in the next lesson, objects are things that do work
  19. for us in a programming language. This particular object represents the
  20. terminal window, the window in which a string or a number is printed when
  21. println does its job. Finally, this part is called a method we'll talk much
  22. more about methods in the next lesson. For right now, just think of it as an
  23. instruction that's being executed. As you can tell from this part of the name,
  24. the instruction is to print something on the terminal window. What's with the
  25. ln back here? That says that it should also be prepared to make the next
  26. printout appear over here. So if we first print ln Hello World, and then we
  27. print three plus four plus five that printout will appear here on the next
  28. line. Without the ln it doesn't make the next printout appear on a new line.
  29. You'll practice working with both of these methods. With Sarah in just a
  30. minute.