Similar to method overloading, constructor overloading is used when you want to call the constructor by passing in different parameters.
Method overloading in Java is used when we want to declare a method with the same method name while passing in different parameters. We can add more parameters or use different data types to tell Java which method should be executed.
Variable scope in Java refers to where a variable is accessible. With scope, we can reuse variables with the same name as long as they are part of different scopes.
Functions, or methods, in programming languages allow you to reuse code, making things more readable and maintainable. Instead of having to rewrite a bunch of code again, we can just call a function that will execute a block of code.
The continue and break statements in Java have the effect of interrupting the way loops are run. They can be used to bypass certain code in a loop. The break statement causes a loop to exit while the continue statement allows a loop to skip the current iteration.
The for loop in Java is the loop that is typically most used in programming. For loops are great when we know how many times we want the loop to execute. For example when looping through an entire array, we can use the array's size.
The do-while loop in Java is similar to the while loop. The main difference is that the loop body gets executed first and then the terminating gets evaluating after. This means that the loop is guaranteed to run at least once.
Loops in programming languages allow code to be repeated multiple times until a condition is met to stop repeating the action. They help reduce the number of lines of code or the number of times the action should be repeated.
The increment and decrement unary operator in Java lets you increase or decrease the value of a variable by one. It can be a shorter notation than using the compound assignment operator.
Compound assignment operators are commonly used as they require less code to type. It's a shorter syntax of assigning the result of an arithmetic or bitwise operator.
When comparing a single condition in a chain of if/else(if) statements, the switch statement is an alternative. It consists of an expression that evaluates to a single value.
Java has three logical operators: && (AND), || (OR), and ! (NOT). These are useful to help evaluate whether a condition is true or false. We can use these operators to evaluate boolean values or boolean conditions in if, else if, or else statements.
A fundamental part of programming is the ability to create different flows in an application. For example, we may want to show certain text to the user when they've won a game. This is where the if, else if, and else statements in Java come in handy.
When branches or changes are made by other developers, it's useful to be fetching these changes from the remote repository before pulling them in locally. A safe way to retrieve these updates without affecting your local repository is to use the command 'git fetch'.
Creating and deleting branches using Git are a crucial part of working with version control software. They allow you to build off of previous work and helps teams collaborate by being able to work on new features or bug fixes simultaneously. Developers can simply create new branches off of the main branch and work on their changes.
Handling redirection in a React app is common in a web application. A link can navigate to another page or a button can trigger a redirection. With single page applications, this is handled differently as opposed to a server side rendered application.
Adding CSS is necessary to style your React application. However, without a strictly enforced styling convention, it will be harder to maintain your project over time. This is where using CSS modules in your React app is helpful.
You may encounter a situation where you would want to pass in as many positional arguments or keyword arguments to a function call as you want. This is where args and kwargs in Python come in handy.
Being able to open, read, and write to text files in Python has several uses. Two examples of using text files may be to store some temporary data in a game, ar reading notes. With Python's built-in functions, we can work with text files with ease.
When programming, it's a good practice to make sure your lines of code don't stretch out too long. Otherwise, you may have to scroll to the side just to see the extra bits of code that didn't fit your screen or the code may be harder to read because of word wrapping.
JavaScript's spread syntax consists of ellipsis and is quite useful when it comes to copying values into arrays and objects. Its use makes working with arrays and objects faster and more readable.
My first year of coding professionally has taught me a lot about being a productive developer. Here are some lessons I've learned about coding and improving your workflow.