CodeGym /Courses /New Java Syntax /Practice with variable visibility

Practice with variable visibility

New Java Syntax
Level 3 , Lesson 5
Available

"Hi, Amigo."

"Hi, Diego."

"I brought you a few tasks about the visibility of variables."

3
Task
New Java Syntax, level 3, lesson 5
Locked
What's the cat's name?
Help the cat get a name using the setName method.
3
Task
New Java Syntax, level 3, lesson 5
Locked
Cat register
Write code in the addNewCat method to increase the number of cats by 1 each time it is called. The variable catCount corresponds to the number of cats.
3
Task
New Java Syntax, level 3, lesson 5
Locked
Setting the number of cats
Write the setCatCount method. The method must set the number of cats (catCount).
3
Task
New Java Syntax, level 3, lesson 5
Locked
Name register
Finish writing the code of the setName method so that it sets the value of private String fullName to the value of the local String variable fullName.
3
Task
New Java Syntax, level 3, lesson 5
Locked
Count the number of cats
Write a code that correctly counts the number of created cats (count) and correctly displays the count on the screen.
Comments (119)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Daniel Renteria Level 8, Mexico City, Mexico
21 October 2024
i'm having second thought about buying this course. Explanations are horrible and hard to understand. Seems more professional focus than beginners.
LeonThePro Level 4, Israel
30 October 2024
man i feel like you, but maybe it is too soon to judge... but from the scanner part everything just became worse for me and harder to grasp.
Farhan Khan Level 3, United States
24 September 2024
Absolutely horrible instructions..
Hoist Level 4, San Diego, United States
19 August 2023
See CodeGym Articles (and the Video) for Setting and and Getting data values https://codegym.cc/groups/posts/getters-and-setters > When you see a Topic that is _new_ check out the Articles inside CodeGym. Also their are great Videos. When data is "private" in the class (the blueprint) -- how can it be accessed and modified ?
CT Level 1, India
8 August 2023
hey I just wanted to check how the assignments are getting validated. Do we have access to unit test cases so that we can understand them more clearly?
chonksta Level 6, Dallas, United States
23 June 2023
Search youtube for getters, setters, constructors java
rags 3 Level 5, Wichita, United States Expert
20 June 2023
definitely would say read head first java definitely helped connect the dots for me
abhishe_kira Level 18, India Expert
3 June 2023
hey Learner if you are new to java please watch Oops concept before solving these problems.
rags 3 Level 5, Wichita, United States Expert
20 June 2023
thank you that help allot still alone wasn't enough for me at this point was to frustrated but all and all little here little there and maybe success
Simphiwe Level 33, Johannesburg, South Africa
9 February 2023
Practice makes perfect 💯
Lunita Level 4, Dominican Republic
3 February 2023
I'm proud of myself RN, got all at the first attempt! 😃
Lunita Level 4, Dominican Republic
3 February 2023
NOTE: No need to output in main method. * If a method is declared with the keyword "static", then to access the class variable, you must use "Classname.variableName". * If a method is NOT declared with the keyword "static", then to access the class variable, you must use the special keyword "this", i.e. "this.variableName".