Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What are the four rules for choosing variable identifiers? Can't use any reserved words, start with a digit, contains symbols/spaces and should start with a lowercase letter.
- What is an algorithm? A set of instructions to perform a task.
- What is an assembler? An assembler converts code to Assembly.
- What is casting? Moving one primitive data type to another.
- What is parsing? Moving one non-primitive data type to another.
- What is the difference between pre and post operators for shortcut assignment operators? When the evaluation happens relative to the in/decrement.
- Which of the following are valid shortcut assignment operators? +=
- What's the first index in an array? 0
- What is the syntax for a conditional (or "ternary") operator? boolean expression ? value_if_true : value_if_false
- Why does == not work on objects? It checks the memory addresses that reference them as opposed to the values within them.
- Is a switch statement required to have a default case? no
- When would a switch statement be preferable over an if-nest? When the cases are decimals, enums, literals, constants, or Strings.
- What is the only post-test loop accessible within Java? do-while
- What is a sentinel value? A special value used to terminate a loop.
- Why should you avoid absolute file pathing? foreign directory structure
- What is a delimiter? A delimiter is a sequence of character(s) used to specify when one data item ends.
- What is the default delimiter in Java? whitespace
- What is a token? A token is a section of what is read until the next delimiter.
- What is a method header? All of the method's modifiers, return type, identifier and parameter list.
- What is the difference between a parameter and an argument? An argument is the data passed into parameters. A parameter is the variable in the function declaration.
- What is a method's signature? A signature is a method's name and its parameter list.
- How many returns are allowed per method, as per the Java style guide? 1
- Are all objects immutable? No. Some objects can have their fields changed after construction.
- What's the difference between passing a primitive value to a parameter and passing an object type to a parameter? Primitive will pass a value. Objects will pass a reference to its memory address.
- What is method overloading? When a method has multiple unique signatures.
- What is the concept of method decomposition? The process of taking a program and breaking it down into smaller, manageable units. Each of these smaller units will be performed by a method.
- What is the concept of method cohesion? The method is concise and self-contained. The method should only do one thing. It should be able to function on its own.
- Should a method be dependent on external variables? No. Minimal coupling should be strived for.
- What is Object-Oriented Programming? OOP is a programming paradigm based on the concept of objects that consist of data fields and procedures.
- What are the four principles of OOP? Encapsulation, Abstraction, Inheritance and Polymorphism.
- What is an object? An object is an instance of a class.
- What is an object's attribute? An instance variable, or field, is a data that makes up an object.
- What is an object's state? The value of an object's attribute.
- What is an object's behaviour? Actions the object can perform, represented by methods.
- What is a constructor method? A constructor invokes the creation of a new object.
- Can a class exist without declaring a constructor? Yes, the default constructor is automatically created at compile-time.
- What are the three unique qualities of a constructor? They must have the same name as the class it's constructing. They do not return anything. They are invoked using the new operator.
- What is the this qualifier? When a class needs to reference its own class instance.
- What does instantiating an object do? Creates a memory address reference to itself.
- What is encapsulation? Encapsulation is a principle used to prevent direct modification of class fields.
- What is static? Static means that that specific instance is universal across all similar instances.
- On a UML class diagram, what does an underline mean? static
- On a UML class diagram, what do italics mean? abstract
- When a method is called to be printed, what is the automatic method that is called? toString
- What is an anonymous object? When an object does not have an explicit type.
- What is method overriding? When a subclass method has specific instructions to overwrite its instance of the method of its superclass.
- What is the difference between an API Developer and an Application Developer? API Devs develop classes, AppDevs create applications that use existing classes.
- What is an enumeration? An enumeration is a data type consisting of named values with corresponding integer values.
- What will an enumeration use as its default toString? Its constant name.
- What are properties of utility classes? private constructor, attributes and methods are static
- Are constants automatically static in utility classes? Yes. Constants are static since they are finalized.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement