*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that you could not use a private instance variable in another class. I wonder if an abstract variable will be able to be used in another class.
When would encapsulation be useful?
Encapsulation would be useful when you want attributes to be used in methods within a class and the attributes are not relevant outside of the scope of the class.
Summary
In this lesson, I expanded what I know about classes by declaring instance variables representing an object's attributes. I also learned the difference between public and private access and when the use of a private class could be helpful.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What does this quote make you think about or wonder?
This quote makes me wonder how I can use my coding experience, in correlation with my background as a person, to help make a change in the world.
What do you notice/wonder about the code in this program?
I notice that a method is passed within the Vlogger class with the name Vlogger() that doesn’t specify any parameters or data types. I wonder if these data type-less methods can exist with names different from the class they are made from.
Summary
In this lesson I learned how to create no-argument constructors within classes to assign default values to the instance variables of a class, therefore, creating default values for each object's attributes. This helps to create specific conditions in which an object can be instantiated.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that many different constructors are used within the mountain class to allow an input of a variety of arguments. I wonder if one flexible statement can be used regardless if I want to use one or many arguments when instantiating an object.
What are some limitations of a no-argument constructor?
When using a no-argument constructor, there are no parameters that influence the state of an object at instantiation. Because of this, every object created from a class with no-argument construction will have the exact same state.
What did you discover from the modifications you made to the code?
I discovered from the modifications that I made that many different parameterized constructors can be created within one class, each with a different set of parameters, suitable for a variety of situations.
When do you think it's best to use a no-argument constructor? What about a parameterized constructor?
I think that when you create a class that doesn't need configurable parameters, such as a class for something specific, like a type of instrument, no-argument constructor are more efficient. When you create a broader class, like a dog class, where you would want to specify the species/age/name through parameters, parameterized constructors are more beneficial.
Summary
In this lesson, I learned that I can instantiate objects with a set of user-defined attributes, passed through parameterized constructors. This helps to increase efficiency in my code as I do not need to write separate code to assign specific attributes to objects after instantiation.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that this program uses parameterized constructors to assign attributes to a class. I wonder if there is a faster way to set up the different parameters to reduce the amount of redundancy in my code.
Summary
In this lesson, I learned how to use the this keyword to both differentiate between instance and local variables within a class constructor and to reference a class constructor from within a separate constructor within the same class. This greatly improves the efficiency of my code, reducing redundancy when creating multiple class constructors. Additionally, this clarifies my code by avoiding the creation of arbitrary local variable names to avoid conflict with instance variables.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that this program uses the super keyword to use instance variables from a superclass within the constructors of a subclass. I wonder if super can be used outside of a constructor.
Summary
In this lesson, I learned that I can use the super keyword within subclass constructors to assign values to the instance variables of the superclass. This allows me to set the initialization state for any class, and avoid unnecessary code that attempts to mimic initialization by manually performing a series s of actions.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that the variables within the main method don’t need an access modifier. I wonder if variables in other methods in the tester class need access modifiers.
Summary
In this lesson, I learned how to create and use both primitive and reference variables within the main method/tester class. This helps to store data that I can use at later points within my code. I also learned how to reassign the value of an existing variable within my code.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that the code in this program uses methods to get a returned instance variable from objects of a class. I wonder if methods could be used to automatically instantiate a set of objects all with similar values for their instance variables.
How do you think we should decide when to write an access method for an instance variable?
I think that whenever an instance variable is needed elsewhere in a piece of code, and that instance variable changes between each instance of a class, access methods should be used to account for variability in the value of the instance variable.
A software engineer is designing this class and needs help deciding which instance variables should have accessor methods. Which of these instance variables would you NOT write accessor methods for? Why?
I would not create accessor methods for the password or emailAddress instance variables because making these variables public creates a privacy concern.
Summary
In this lesson, I learned how to use accessor methods to call instance variables outside of the class they are first defined in. This allows me to use the variables in a wider variety of situations, including its use from directly within the tester class.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that in this program, the addition/division of an integer and a double will return a double by default. I wonder how I could change this value back into an integer and what other math-related functions also exist.
Summary
In this lesson, I learned to use expressions and operators to perform arithmetic operations on integer/double variables and to concatenate two or more strings together. Additionally, I learned how to use compound assignment operators to modify the value of numerical variables in a shorter manner.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the code in this program?
I noticed that the code in this program uses mutator methods to change the instance variables of an object. I wonder if mutator methods could be used to change the behavior of a method as a whole instead of just attributes.
Are there values that should be considered invalid for certain instance variables?
Any value that either doesn’t match the specified data type or does not make sense within the context of the instance variable should not be considered valid, such as creating an object for a class of students with 0 students.
Summary
In this lesson, I learned how to use mutator methods to change the value of instance variables after an object has been created. The mutator methods can also be used with scanner objects to accept user inputs as instance variables. Additionally, boolean expressions can be used with relative operators to help control the logic around these instance variables, creating highly adaptable code.
*Note, the majority of this lesson is located within the Unit 2 Guide*
What do you notice/wonder about the output of this program?
I noticed that the output of this program prints the name of the object followed by its location in memory. I wonder what "dot" commands can be used in conjunction with the object name to print different information.
Summary
In this lesson, I learned how to use the toString() method to print specific information about an object when the object itself is printed. The toString() method can be used along with the super keyword to print out the information specific for the subclass' superclass as well.
*Note, the majority of this lesson is located within the Store Management Project Planning Guide*
What does this make you wonder about how you could create a management system for a business?
It makes me wonder about what kind of information I need to include when I create a management system for my business.
What do you notice about the project requirements and rubric?
One noticing I have is that the rubric requires us to successfully implement a toString method within our code along with at least one of each other concepts taught within Unit 2.
What does success look like for this project?
Success looks like following all criteria on the rubric/requirements along with creating a coherent and successful business management program.
What barriers do you anticipate to achieving success on this project?
The biggest barriers I anticipate are time and the restrictions of the IDE. I only have three days to work on this project, meaning that I have to use my time efficiently and may not be able to get to anything. Also, the project IDE prevents me from creating a UI at this point.
Summary
On the first day of the store management project, I broke down the structure of my program, deciding on what attributes and methods I wanted for each of the classes. Additionally, I planned out what user interaction I wanted for my program.
What are some factors that software engineers might need to consider as they prioritize which changes to make to their code?
When engineers prioritize which changes to make to their code, they need to consider what aspects are essential to the program's functionality, and which changes may simply improve or simplify their code. Of course, if the code becomes too unorganized or "clunky," it may be hard for the programmer to make necessary changes to their code.
Summary
On the second day of the store management project, wrote the majority of the code for my project, with all code finished bearing the exception of the main method. Inconsistencies in the handling of the scanner class have provided a challenge that I will attempt to address on day three.
Summary
On the last day of the project, I completed the rest of my program, revising for functionality and efficiency. After I finished my code, I opened up my project for a code review, in which my peers analyzed my work to make suggestions for possible improvements.
*Note, the majority of this lesson is located on the paper FRQ handout*
What is your impression of this FRQ?
My overall impression was that the FRQs are becoming more challenging as the year continues, incorporating more and more concepts as our knowledge of Java expands. Regardless, I was still able to complete this FRQ fairly successfully.
What knowledge and skills did you use that you learned in this unit?
I essentially incorporated the majority of the skills I learned from this unit. When creating the Burger class, I used most of the class structure and design-related syntax to ensure correct functionality, from parameterized constructors to mutator methods.
What were you confident about? What would you like to practice?
I was confident about the creation of methods and variables within the class I created. I would like to practice the handling of accessor methods in situations with more complex hierarchies and practice complex class structures in general.
Summary
In this lesson, I completed the Burger Class FRQ, creating a subclass that can properly refer to its superclass and its own attributes. After completing the FRQ, I scored it with a rubric, analyzing both my success with the assignment, alongside my failures, which outline areas of improvement moving forward.
Summary of the topics covered in Unit 2:
Unit 2 went in-depth on everything class design. All revolving around class instance variables, Unit covered no-argument and parameterized constructors, along with the use of the this keyword. Outside of constructors, accessor and mutator methods could also be used to get or change instance variables. Additionally, more complex or efficient code structures can be created with different operators in Java, whether to evaluate mathematical expressions or create a boolean expression.
Successes or topics I feel I understand well:
I think that I understand the majority of Unit 2 well, especially the syntax around each of the topics covered. One area I feel especially strong in is the integration of object instantiation with user input using the scanner class.
Trouble areas or topics I still have questions about:
One area I still have questions about is if I could make a constructor for a class dependent on already instantiated objects within the main method.
A personal goal that will help improve my understanding in those trouble areas:
One goal that would improve my understanding of this question is to review the official Oracle Java documentation to truly understand the rules regarding constructor creation in Java. I could follow this up with a short personal project that attempts to utilize this kind of dependency.