CodeGym /Courses /Java Syntax /Useful links from the Professor – 5

Useful links from the Professor – 5

Java Syntax
Level 5 , Lesson 10
Available

"Greetings, Amigo! As I understand it, you attended my lesson on the physical foundations of the space-time curvature of pipes? No? Well, why not? Do you need additional materials about the fifth level? Well, here you go."

Why do we need constructors?

"Have you already asked yourself this question? And did you find the answer? Are you sure the answer is correct? Let's check! How do you create a default cat without any distinguishing features? How do you create the same cat, but with a certain color fur and tone of voice? You don't know? Here's an excellent article on the very basics of constructors in Java. Read and be enlightened!"

Base class constructors

"You're currently starting to dig into constructors in Java. So, one interesting article I found in our ship's storage bins won't hurt you. It's about base class constructors, and is designed just for your level. You will learn (or review) what superclasses and subclasses are, the order that constructors are called in, and the order that fields are initialized in."

"I don't have a lot of articles for you today, but the topic is very important. So immerse yourself in it. And if you want to read something else about constructors, 'Head First Java' will save the day! Or, Cay Horstmann's 'Core Java' is also an excellent textbook. Think it's too early to read it, since you're not a professional yet? Think again. Professionals aren't born, remember?"

Getters and setters

"Once upon a time, you didn't know what encapsulation is and why it is needed. And maybe even now you don't feel confident when we talk about hiding a class's data and helper methods (getters and setters). If so, then please be so kind as to review a very useful lesson, which will most likely strengthen your understanding of encapsulation."

Ternary operator

"Beginners find this beast very unusual. And by and large you can do without it, but the ternary operator does cut down on code so well! So, if you don't already know about this replacement for the if-else construct, I recommend that you familiarize yourself with it and begin to integrate it into your code."

"And I've also decided to recommend a book for future reading. Since the lesson on the ternary operator is about code readability, remember this book title—'Clean code'—and its author—Robert Martin."

"This book brings together best practices and recommendations for programmers, which will help you write code that is not only functional, but also easily readable."

Comments (24)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Stanislav Mayer Level 15, Czech Republic
16 January 2022
Don't get confused: the "Getters and setters" link was already provided to us in "5.4. How to create objects" by Ellie :-)
Anonymous #10775689 Level 14, United Kingdom
28 July 2021
FYI I just saw that Head First Java, 3rd Edition is due out by 31 Dec. 2021.
Sinisa Level 11, Banja Luka, Bosnia and Herzegovina
22 February 2021
I'm pretty sure newbies won't even consider solving tasks using OOP/Classes. 95% of them will simply write procedural thing which is the logical thing to do and for which this topics are irrelevant. Concepts that are being taught here are advanced techniques for the problems that are better expressed by OOP, they should indeed be taught and practiced, but they create unnecessary confusion if imposed upon straight away.
阿鑫 Level 22, China
1 February 2021
good
Yuxi Zhou Level 9, New York, United States
4 November 2020
I don't think Professional Library is actually a textbook? Does codegym refers it as all the publishes by Cay? I'm confused
John Squirrels Level 41, San Francisco, Poland
5 November 2020
Thank you for attention. We will correct it shortly. Have a great day.
Joe M Level 47, Owings Mills, United States
17 October 2020
excellent. Thank you
Attila Level 7, Hainault, United Kingdom
15 July 2020
inheritance getter setter full presentations
Rose Level 14, Richardson, United States
25 June 2020
THANK YOU. This could take more than a month to explain at the university. I like Codygym more.
ashley819 Level 9, Washington DC, United States
13 June 2020
I second "Head First Java"- it's a great resource! I checked it out from the library first, then realized it would be a great resource to look through whenever I wanted, so I bought it on ebay :)
Nirake_ Level 8, Mumbai, India
5 June 2020
Amazing explanation by prof. All the Lesson's treasure is actually here.