Level 24 Level 26
Level 25

[Quiz] Basics IV

84 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Java Compiler
A program that translates code in a high-level language (such as Java) to machine instructions (such as bytecode for the Java virtual machine).
Source Code
The source code of a class determines the structure and behavior (the fields and methods) of each of the objects of that class.
When compiling into the Java VM, what is the platform-independent code it can understand called?
Converts source code to machine-readable form
Integrated Development Environment. A software application that provides comprehensive facilities to computer programmers for software development.
Data types
Describes the type of information stored in a variable or object.
instance of a class. A software bundle of related variables and methods used to model real world objects. It has 2 defining characteristics - STATE and BEHAVIOR. State is stored as variables and behavior is represented using methods
A conversion of a large memory data type to a smaller memory data type making the two compatible for the compiler.
a code for information exchange between computers made by different companies
eight bits
Variable types
Four types: loop, instance, static, and local.
Java Virtual Machine. Software inside various electronic platforms that reads and runs compiled bytecode.
memory management
objects are dynamically allocated using the new operator. Eventually these objects are destroyed when no references to the object exists and their memory released for later allocation. In Java, memory is automatically de-allocated.
garbage collection
The technique that automatically de-allocates and reclaims memory is called garbage collection. It occurs only sporadically and it cannot be forced. But it can be requested. To request it, use the gc() method of class java.lang.Runtime or java.lang.System.
wrapper classes
wrapper classes allow for primitive data types to be inserted into a collection (like an arraylist). They are useful whenever it would be convenient to treat a piece of primitive data as if it were an object.
The String class represents an immutable, e.g. cannot be changed, string of characters with its own methods.
An instance of Java's StringBuffer class represents a string that can be dynamically modified, e.g. mutable. It too has it's own methods for string modification.
DEPRECATED is used to parse the string and split into substrings using a delimiter. It is more common to use the split() method of the String class. See split below.
like StringBuffer, allows for dynamic modification of a string. It has it's own methods. The difference between StringBuilder and StringBuffer is that StringBuilder is unsynchronized where StringBuffer is synchronized.
String vs StringBuilder vs StringBuffer
Criteria to choose among String, StringBuffer and StringBuilder - If your text is not going to change use a string Class because a String object is immutable. If your text can change and will …
file I/O
stands for file input/file output.
reading to a file
the "input" part of file I/O. The java library associated with input would be inherited from the InputStream. The FileInputStream class creates an InputStream that is used for reading streams of raw bytes from a file.
writing to a file
The "output" part of file I/O. The java library associated with output would be inherited from the OutputStream. The FileOutputStream class creates an OutputStream that is used to write bytes to a file.
A collection is an object that groups multiple elements into a single unit. It is used to store, retrieve, and manipulate data, and to transform data from one method to another. It is the …
an interface that extends Collection to handle sets, which must contain unique elements.
a class that supports dynamic arrays that can grow as needed. That is, an ArrayList can dynamically increase or decrease in size.
A Linked List is ordered by index position, like ArrayList, except that the elements are doubly linked to one another. So this linkage gives new methods for adding and removing from the beginning or …
The Hashmap provides an unsorted, unordered Map. With a Map the elements are not ordered. HashMap allows one null key and multiple null values in a collection
Hashtable is a synchronized counterpart to HashMap. Hashtable does not allow any null values.
A thread is an independent sequential path of execution within a program. It is an instance of a class java.lang.thread. It is a light weight mini process.
The process of allowing the methods of object(s) or a block of code to be executed by one thread at a time is called synchronisation. It is achieved by using the keyword synchronized.
JDBC Connection
Java Database Connectivity (JDBC) is an application program interface (API) specification for connecting programs written in Java to the data in popular databases.
Properties File
Properties file is always used to store the configuration data or settings.In simplest terms, properties files are nothing more than text files that contain name-value pairs, or rather key-message pairs.
Reflection API
Reflection is commonly used by programs which require the ability to examine or modify the runtime behavior of applications running in the Java virtual machine.
Design Patterns
A design pattern is an abstract solution to a problem. Software engineers can ameliorate the need for design by reusing existing designs- in whole or in part.
Factory pattern
Factory Method is a creational pattern. This pattern helps to model an interface for creating an object which at creation time can let its subclasses decide which class to instantiate. We call this a Fac…
Singleton Pattern
The singleton pattern ensures that a class has only one instance and provides a global point of access to that instance. It is named after the Singleton set, which is defined to be a set containing one element.
MVC stands for Model-View-Controller. It's a way of designing an application that separates data access, business logic and the graphical user interface. The Model refers to the data and how it is handled, the …
Buisness Delegate
In distributed applications, lookup and exception handling for remote business components can be complex. When applications use business components directly, application code must change to reflect changes in business component APIs. These problems ca…
Difference between FINAL, FINALLY & FINALIZE
FINAL - a final class cannot be extended. A final method cannot be overloaded. A final variable is a constant.
allows a class to be a subclass of a superclass and thereby inherit public and protected variables and methods of the superclass. A parent/child relationship.
describes the way an object or variable my be treated in different contexts as though it was a different type. For example: inheritance allowes an argument of type B to be passed to a param…
helps hide implementation behind an interface or API
means an instance of one class "has a" reference to an instance of another class or another instance of the same class.
degree of dependency between classes
each class must represent a single concept, and all its constructors and public methods should be related to that concept
members of class
Instance variables and methods defined in a class are known as the members of the class.
procedures for constructing new object in class/ initializing its fields
Methods with Parameters
Methods can have a comma separated list of inputs. The same method name can be overloaded by using a different set of parameters.
Method Overriding
A method of the same name and argument list as a method in a parent class, so it replaces the parent method.
Method Overloading
Different methods that have the same name but different argument lists.
Multidimensional Arrays
Arrays can have 2 or more dimensions. For a 2 dimensional array, the first index is the row and 2nd is the column. (ex: myArray[2][3] is row 2 column 3.
exception handling
an exception is a run-time error. There are 2 types of exceptions - checked and unchecked. If a checked exception is not handled, the code will not compile. Java exception handling is managed …
System exception
An exception thrown by the JVM.
Application exception
An exception thrown by a throws clause in the Java code.
Errors can be caught by the compiler or at run-time by the JVM. An example run-time error is "File not found".
String API
This is the String Class definition which is in the java.lang package.
Abstract Classes
A class that cannot be instantiated (can't use new on it). It can only be extended and is used to define base classes.
Similar to an abstract class except all its methods are implicitly abstract which means they must be implemented by the class that "implements" the interface. A class can implement as many Interfaces as it li…
the process of converting a set of object instances that contain references to each other into a linear stream of bytes, which can then be sent through a socket, stored to a file…
Gives programmers a way to test their assumptions during development and debugging.
how do you create a Collection?
Same way as an object, with the "new" keyword
What is a Collection?
used to store, retrieve, manipulate and transform data from one method to another
What's the difference between a Set and List?
Sets don't allow for duplicate elements. Lists do.
What is <String>?
is called a generic, it is optional. It's used to restrict datatype in Sets and Lists. It contains the name of a wrapper class.
key/value pairs
What does a Hashtable store?
What is Enumeration?
It is a type of list that doesn't change, aka constants. An example is a list of the days of the week.
What's the difference between a Set and TreeSet search?
TreeSet uses binary search, Set uses sequential search which is slower.
automatically sorted ascending.
Details of a TreeSet
Wrapping and extending classes.
What are some examples of encapsulation?
What is another name for the Default access modifier?
What is a Class?
A blueprint of an object that defines all the variables and methods common to all the objects of a certain type.
What is an Object?
An instance of a class. They all have state (variables) and behavior (methods).
How is a class declared?
By use of the "class" keyword.
What are Class members?
variables and methods defined in the class.
What's important when naming Classes?
The first letter is always in uppercase. The name of the class and file should be the same.
The main() method.
What must be present in order to execute the program?
A raw java file that can be viewed and edited.
What is the file extension of a compiled Java program?
What are the 8 primitive data types?
byte, short, int, long, float, double, char, boolean
1 byte = 8 bits. -128 to 127
how big is a byte datatype and what is its lower and upper value range?
how big is a char?
2 bytes = 16 bits
How big is an int?
4 bytes = 32 bits
true, false (case sensitive)
What are the correct values of the boolean data type?