Level 25 Level 27
Level 26

[Quiz] Basics V

100 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

What is an Array?
It's a group of like-typed variables that are referred to by a common name. Arrays can be of any type or dimension.
by it's index
How is a specific Array element accessed?
What does datatype conversion mean?
Changing a variable from one type to another, i.e. converting byte to an int.
What is Casting?
Converting objects from one type to another. To convert int to a byte, you need to cast int as a byte.
String is immutable, StringBuffer is mutable.
What's the difference between "String" and "StringBuffer"?
StringBuffer is synchronized, StringBuilder is unsynchronized.
What's the difference between "StringBuffer" and "StringBuilder"?
What is synchronization?
It enforces thread safety. Ensures that only only one thread can access a resource at a time.
command line arguments
What does the arg[] array contain?
What's an implicit conversion?
An implicit conversion is done automatically, e.g. convert byte to an int (byte is smaller than int) so done automatically.
What's an explicit conversion?
An explicit conversion is performed manually by the programmer, e.g. convert int to byte (int is greater than byte) you have to Cast it.
+ Addition (binary operator)
What are the standard Operators?
== equals to
What are the Relational Operators?
& logical and
What are the Boolean Logical Operators?
if/else statement
What are the control statements?
What's the difference between a HashTable and HashMap?
A HashTable is synced, a HashMap is unsynced.
builds XML files
What does ANT do?
What's the difference between a While and Do-While loop?
A Do-While loop will always execute at least once.
What does Break statement do?
Breaks out of the control statement if the condition is met.
What does the Continue statement do?
Goes to the next iteration of the control statement instead of performing the action in the condition.
static, local, instance, loop
What are the four types of variables?
What is a static variable?
When a member is declared static, it can be accessed before any objects of its classes are created. the member is only accessible to the class. Only static members can access other static members. T…
Every method should have a return type. If it doesn't return anything what is the return type?
return <variable or value of return type>
If the method does return a value, what type of statement should be included at the end of the method?
True or False: Primitive data types are predefined by the programming language. A user can't define a primitive data type in Java.
If there is a method "sum(int x, int y)", what is the return type?
What is a Constructor?
This is a special method used to instantiate objects of a particular class. It is used in conjunction with the new operator. It initializes an object immediately upon creation. Once defined, it is called immedia…
What are the characteristics of a Constructor?
it has the same name as the Class
What is method overloading?
Method overloading happens when you have two methods of the same name with but with different number of parameters. It is an example of polymorphism.
What is dynamic binding
call the specific method at run time based on the parameters passed.
T or F. A constructor cannot be overloaded.
False. When you create a constructor, it unknowingly overloads the default constructor.
When is a default constructor created?
When the programmer does not create a constructor, the compiler creates a default constructor automatically.
Explain the "public" access modifier's visibility
When a member is declared public, it can be accessed by any other code.
Explain the "private" access modifier's visibility
When a member is declared private, it is only accessible to other members of the same class.
Explain the "default" access modifier's visibility
A default member can only be accessed if the class accessing the member is in the same package. When no access control is provided to the member, it automatically assumes the default access.
Explain the "protected" access modifier's visibility
A protected member can only be accessed through inheritance by a subclass even if it's in another package.
-it's contents cannot be changed
What are the characteristics of a "final" variable?
What package is the String class in?
When are command line arguments used?
When we want to pass arguments to the main() method. Values are stored as a String array "args[]" in the main method.
What are instance variables?
An instance variable is a variable which is related to a single instance of a class. Each time an instance of a class is created, the system creates one copy of the instance variables related to that class.
What is inheritance?
Inheritance allows us to encompass the parent class' state and behaviors into its child. The child class can then extend the state and behaviors to reflect the differences it represents. The most important aspec…
What is a Super class?
The class that is inherited.
What is a sub class?
The class the does the inheritance.
How do you achieve inheritance?
To achieve, inheritance, the "extends" keyword is used.
T or F. A sub class can access private members of the super class
False. A subclass cannot access private members of the super class. Therefore, if you declare a variable private in the super class, the sub class does not have access to it.
What is the Constructor execution sequence in Inheritance?
Constructors are called in order of derivation, from Super class to Sub class.
What is an abstract class?
They are used to declare common characteristics of subclasses. An abstract class cannot be instantiated, only extended. Abstract classes are declared with the "abstract" keyword. Can have both implemented and abstract methods.
What are characteristics of abstract classes?
-a method can be abstract, which means at least one of the methods there is no body/content.
Final method
If a method is declared "final" then the method cannot override that method.
Final class
If a class is declared "final" then the class cannot be inherited to the subclass.
What is the java class library?
The Java Class Library is a set of dynamically loadable libraries that Java applications can call at runtime.
What are the characteristics of Interfaces?
- it is similar to a class, but is declared with keyword Interface.
What's the difference between checked and unchecked exceptions?
Checked exceptions are thrown at compile time. Unchecked exceptions are thrown at runtime.
What is an exception?
An exception is an abnormal condition that arises in a code sequence at run time.
Try, catch, throw, throws, finally
What are the five exception handling keywords?
use the keyword "throw"
How do you manually throw an exception?
use gc() method.
How to request garbage collection?
When you do not assign a value to boolean byte it's default is:
What are Wrapper classes?
Allows for primitives to be inserted into collections or sent over the network. Useful whenever it would be convenient to treat a piece of primitive data as if it were an object.
What method is used to parse a string and split it into an array using a delimiter?
what class and method refers to keyboard input?
what's word is synonymous with Serialization (according to Karan)?
Define "multithreading"
The ability of an operating system to execute different parts of a program, called threads, simultaneously.
Define "Collection"
A collection is an object that groups multiple elements into a single unit. It is used to store, retrieve, manipulate and transform data from one method to another.
What's the difference between a List and Set?
A list can contain duplicate elements, a Set cannot.
What's the difference between an array and an ArrayList?
An array has a set size. An ArrayList can increase and decrease in size.
What method allows for printing the contents of a Collection class?
What I/O class is used to for reading streams of characters?
Define "Serialization"
Serialization is the process of writing the state of an object to a byte stream.
How to achieve Serialization?
implement the Serializable interface.
Define "Properties file"
A properties file represents a persistent set of configuration properties.
What states can a thread have?
running, suspended, resumed, blocked & terminated
How do you create a new thread?
Either extend the Thread class or implement the Runnable interface.
What is JDBC?
Stands for "Java database connectivity". It is an API that documents how to connect to a database. It's part of the java.sql library.
A prepared statement is pre-compiled. A simple statement is not.
What's the difference between a simple statement and a prepared statement?
T or F? The method to use for SELECT statements is executeUpdate.
False. The answer is executeQuery. All other types of SQL statements (CREATE, MODIFY, DELETE) use executeUpdate.
What is a transaction?
A transaction is a set of one or more SQL statements that are executed together as a unit, so either all the statements are executed (COMMITTED) or none are (ROLLED BACK).
True. conn.setAutoCommit(false);
T or F? In order to properly execute a transaction, auto-commit mode must be disabled.
What's the name of the method used to abort a transaction?
What is a data structure?
An arrangement of data inside a computers memory or a disk.
Name 5 data types
BLASH: binary trees, linked lists, arrays, stacks, hash tables
What do algorithms do?
Manipulate the data in data structures in various ways such as sorting.
What is real-world storage data?
Data structure storage that describes physical entities external to the computer. Accessed by a programs user.
What are programmer's tools?
Data structure storage that is accessed by the program itself. Ex - stacks and queues.
What is real-world modeling?
Data structures that directly model real-world situations...think graphs.
Create a new object in Java.
The keyword "new" is used to do what?
An instance of a class.
An object is often referred to as:
object.method(); is and example of
Invoking a method for a specific object.
By interacting with an objects methods
How do other parts of your program interact with objects?
How is the constructor named?
It has the same name as the class it resides in.
Methods that are apart of the same class.
A field of method that is private can only be accessed by
Using a method of that class.
Any outside entity that wants to access data in a class can do so by:
throws IOException
What must be added to all input methods for them to work?
What does the charAt() method do?
Returns a character at the specific position in the string object.
What does the parse.Int() method do?
Converts the string type into an integer.
Binary data type
Data type indicative of a single symbol
16 bits long. 16 bit integer (-32K - 32K)
64 bits long 64 bit intiger
32 bits long. 32bit FLOATING POINT
64 bits long. 64bit FLOATING POINT