What is recursion in programming?
Recursion is a programming technique where a method calls itself to solve a problem by breaking it down into smaller subproblems.
How many types of answer can you recieve from a boolean statment.
2: true and false
What is the index of the first element in an array in Java?
The index of the first element in an array is 0.
What is the purpose of the "this" keyword in Java?
The "this" keyword refers to the current instance of a class and is used to access instance variables or invoke other constructors within the same class.
What are the two main components required for a recursive method?
base case and recursive case
What is the value of the expression "true && false" in JavaScript?
false
How do you access the value at index 3 in an array named "myArray" in Java?
myArray[3];
What is the difference between the "==" operator and the ".equals()" method in Java?
The "==" operator compares the memory addresses of objects, while the ".equals()" method compares the actual contents of objects.
What is the difference between direct recursion and indirect recursion?
Direct recursion occurs when a method directly calls itself. Indirect recursion occurs when a chain of method calls results in a method calling itself indirectly.
!(!(!(!(T||F))))
true
How do you declare an array of integers named "numbers" with a length of 5 in Java?
int[] numbers = new int[5];
What is the purpose of an interface in Java?
An interface in Java defines a contract for a group of related classes, specifying the methods that these classes must implement.
When using recursion, what is the purpose of the call stack?
The call stack keeps track of method calls and their corresponding variables, allowing the program to return to the correct point after each recursive call completes.
whati s demorgans law
conditional stamtents
Explain the difference between arrays and ArrayLists in Java.
Arrays have a fixed length and their size cannot be changed once defined. ArrayLists, on the other hand, are part of the Java Collections Framework and can dynamically grow or shrink in size.
Explain the concept of inheritance in object-oriented programming
Inheritance allows a class to inherit the properties and methods of another class, known as the superclass. It enables code reuse and the creation of more specialized classes based on existing ones.