Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

Core Java

QuestionAnswer
List all non-access modifiers static - creating class methods and variables final - finalizing the implementations of classes, methods, and variables abstract - creating abstract classes and methods synchronized and volatile - used for threads
What are static imports? facilitate the java programmer to access any static member of a class directly
What non-thread methods are available in the Object class? protected Object clone() throws CloneNotSupportedException public boolean equals(Object obj) protected void finalize() throws Throwable public final Class getClass() public int hashCode() public String toString()
How would you perform constructor chaining? use this() and super()
Explain the principles of the SOLID acronym - S Single Responsibility
What is the difference between an abstract class and an interface? an interface cannot have state, whereas the abstract class can have state with instance variables
What are covariant return types? What rules apply to return types for overridden methods? return type of an overriding method
What are the implicit modifiers for interface variables / methods? All constant values defined in an interface are implicitly public , static , and final
How do you serialize / deserialize an object in Java? For serializing the object, we call the writeObject() method of ObjectOutputStream class, and for deserialization we call the readObject() method of ObjectInputStream class. We must have to implement the Serializable interface for serializing the object
What is a Marker interface? What does Serializable interface do? Marker interfaces in java are interfaces with no members declared in them. They are just an empty interfaces used to mark or identify a special operation. Serialization is a mechanism of converting the state of an object into a byte stream
What are transient variables? variable which have a non-serialized value at the time of serialization. A variable that is initialized by its default value during de-serialization
Difference between FileReader and BufferedReader? FileReader reads characters from a file while BufferedReader reads characters from another Reader
Explain the try-with-resources syntax declares one or more resources in it. A resource is an object that must be closed once your program is done using it. declares one or more resources in it. A resource is an object that must be closed once your program is done using it
List some methods in the Scanner class nextBoolean() nextByte() nextDouble() nextFloat() nextInt() nextLine() nextLong() nextShort()
What can you do with the Reflections API that you can’t do in normal code? used to manipulate class and its members which include fields, methods, constructor, etc. at runtime. One advantage of reflection API in Java is, it can manipulate private members of the class too.
What are Singleton / Factory design patterns? singleton has single method, like get(). The purpose of the factory is to create and return new instances.
Explain the DAO design pattern isolate the application/business layer from the persistence layer (usually a relational database but could be any other persistence mechanism) using an abstract API.
How would you create a Singleton? Static member Private constructor Static factory method
What are the core interfaces / classes in JDBC? class DriverManager interface Driver interface Statement interface PreparedStatement interface CallableStatement interface Connection interface ResultSet interface ResultSetMetaData
What is try-with-resources? What interface must the resource implement to use this feature? statement followed by one or more catch clauses, which specify handlers for different exceptions. AutoCloseable interface is needed
What new syntax for creating variables was introduced with Java 10? It allows to define a variable using var and without specifying the type of it. The compiler infers the type of the variable using the value provided. This type inference is restricted to local variables.
What are collection factory methods? a static method that provides a simple way of initializing an immutable Collection<E>
What is java? Java is a programming language and computing platform. Java is secure and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!
Why java? It’s portable. Easy to learn. It has simple syntax based on C. Object-oriented. Automatic memory management. Rich API. Java is FREE. Supported by Oracle Corporation.
JDK? JDK - java development kit JDK is [JRE + development tools]. Dev tools include: the compiler + debugger + javadocs + etc. The compiler turns source code (.java files) into bytecode (.class files).
What is a bit? What is a byte? What is a nibble? "A bit is a binary value (0 or 1 aka ON or OFF) A nibble is 4 bits (16 different combinations 0s and 1s. 2^4) A byte is 8 bits (256 different combinations of 0s and 1s. 2^8)"
What is the JVM? "JVM - java virtual machine The JVM allows java bytecode (.class files) to be executed on your machine (binary). Loads, verifies, and executes code. The JVM is abstract in nature."
JRE? JRE - java runtime environment JRE is [JVM + the set of necesary libraries]. Minimum requirement to run java code.
What are the class naming conventions in java? " Naming conventions of java: class names: title case. e.g. Animal, UserStory, ButtonColors interface names: title case. e.g. Runnable, Comparable adjectives
What are the methods naming conventions in java? method names: camel case. e.g. drawRectangle, run verbs package names: lowercase. e.g. java, lang, sql, util, etc
What are the instances naming conventions in java? variable names: camel case. e.g. myFirstName, myLastName constants: uppercase. e.g. RED, YELLOW, MAX_PRIORITY, etc"
What are the non-numberic primitive datatypes in java? "● boolean - a true or false value (1 bit in size) ● char - a single character value (2 bytes in size)
What are the small primitive datatypes in java? ● byte - a smaller space efficient integer representation (1 byte in size) ● int - a integer numeric value (4 bytes in size) ● short - a smaller space efficient integer representation (2 bytes in size)
What are the large primitive datatypes in java? ● long - a large integer representation (8 bytes in size)" ● double - a decimal numeric value (8 bytes in size) ● float - a floating point value. Holds big decimals with less precision (4 bytes in size)
What is flow control? "Flow control statements break up the normal flow of execution by employing decision making, looping, and branching, enabling your program to conditionally execute particular blocks of code. Types of flow control statments include:
What are flow controllers? ● if, else if, and else blocks ● ternary statements ● switch cases ● while loops ● do while loops ● for loops ● enhanced for loops (aka for each loops) ● try, catch, and finally blocks"
What does the keyword "break" do? "Break tells java to cease the logic of the current code block. Java will then begin processing the logic just after the code block's ending curly brace. Break may be used in if statements, while loops, etc.
What does the keyword "continue" do? Continue tells java to cease the logic of the current code block THEN go back to the top of the loop's code block. Java will then begin processing the logic as if it has reached a new iteration of the loop."
What is short circuiting? "Short circuiting deals with && and || operators. if the computer knows if the answer statement is impossible to be true, it will skip subsequent conditions
What datatypes does a switch case allow? "Switch cases only allow the following datatypes in its condition declaration: ● int (and Integer, the wrapper class) ● short (and Short) ● byte (and Byte) ● char (and Character) ● String ● enum"
What is an array? "It's a series of data entries sequential in memory (of the same data type). We can access each element of an array using square brackets [ ].
How to create an array? We can create arrays in two ways: ● int[] arrayOne = {15, 88, 99}; ● String[] arrayTwo = new String[200];
What method do you call to find the size of an array? "You can find the size of an array (number of element) by using: myArray.length; BUT "".length"" is NOT a method; it's a property of an array."
What is a method? "A modularized block of code; created by putting a series of statements between two curly braces. This special block of code will be given a name so that it can be referred to later.
What is a method signature? The method signature in java is: [any modifiers] [the return data type] [the method name] ( [the parameter list] ) { // my logic }"
What is a function vs a method? "A method is simply a function that is attached to an object It's truly as simple as that. Java is almost entirely object oriented so it strictly uses methods, not functions."
What is method overloading? " Overloading is when you have multiple methods with the same name, but different parameter lists. This concept does not need inheritance to exist; it happens all within the same class."
What ways to change an overloaded methods signature? There are three ways to change the parameter list: ● change the data types ● change the number of parameters ● change the order of the datatypes in the parameter list
What is var args in java? "Var args means variable arguments. It's when you create a method that is able to to handle a variable number of arguments. You would use the ""..."" operator behind the FINAL parameter's data type.
What is a class? "A blueprint for an object. A class is abstract in nature, you can not have a physical instance of a class; it simply defines the structure of an object.
What is an object? "An instance of a class. An object has state (variables) and behavior (methods). States are things like ""size"", ""weight"", ""height"", ""color"", ""length"", etc. Behaviors are things like ""bounce"", ""makeNoise"", ""changeColor"", etc.
What are the four pillars of object oriented programming? Abstraction "Abstraction - OOP concept that displays what something is and what it does but not how it does it. Showing purpose but hiding implementation. In java, we the abstract classes and interfaces to achieve abstraction."
What are the four pillars of object oriented programming? Polymorphism Polymorphism - that allows one task to be performed in different ways. Variables and methods to take multiple forms. you can find in method overloading and overriding. In java, we achieve this using method overloading, method overwriting, and casting."
What are the four pillars of object oriented programming? Inheritance "Inheritance - OOP concept that allows one class to inherit the properties of another (variables, methods, and ""maiden name""). It allows code to be reused. In java, we achieve this using the ""extends"" and ""implements"" keywords."
What are the four pillars of object oriented programming? Encapsulation "Encapsulation - OOP concept that is data hiding. Restricts direct access to data. In java, we achieve this by creating public getters & setters that access private variables."
What is a constructor? "A constructor is a special method that constructs an instance of the class (aka an object) and initializes the object's state. The name constructor is the same name as the class itself, and it does NOT have a return type."
What does the keyword "new" do in java? "The new keyword is a Java operator that creates the object; it is followed by a call to an object's constructor. Example: MyObject myObj = new MyObject();"
Can you name 3 types of constructors? "● the default constructor ● the no args constructor ● args constructor (can have any number of overloading variations)"
Is the default constructor and the no args constructor the same thing? "NO! The no args constructor is a constructor that has an empty parameter list. The default constructor is that constructor that the compiler will automatically write for you if you compile the code without having written your own constructor.
"this" keyword? "The keyword ""this"" is used to refer to the CURRENT object/instance. Using the ""this"" keyword from inside a constructor with parenthesis (ex: ""this()"") will call a different constructor from the current constructor.
super keyword The keyword ""super"" is used to refer to the current object/instance's PARENT. Using the ""super"" keyword from inside a constructor with parenthesis (ex: ""super()"") will call a parent's constructor from the current consturctor."
What is the difference between initializing and instantiating? Initializing could POSSIBLY include instantiation; but just because you see initialization doesn't mean something is being instantiated.
Initializing "Initializing is when you give an initial value to a variable: char c = 'x';
Instantiating Instantiating is when you create an object instance. Root word ""instance"" like when you create an INSTANCE of a class (aka an object).
What are the scopes of a variable in java? static "● Static (aka class) The variable/method belongs to the class itself. The class has one copy of the variable that all instances share.
What are the scopes of a variable in java? instance/object ● Instance (aka object) Each object has its own copy of each variable/method and each object. So changing one object's variables doesn't change another object's variables.
What are the scopes of a variable in java? method ● Method The variable only exists in the method; outside of the method it stops existing.
What are the scopes of a variable in java? block ● Block The variable only exists within a block of code (denoted by curly braces { } ). Outside of the block the variable stops existing."
What is shadowing? "Shadowing is when a parent class and a child class have declare a variable with the same exact name. Shadowing is for variables, Overriding is for method."
How to access a shadow? The parent's version of the variable still exists BUT it can now only be accessed using the ""super"" keyword. The child's version of the variable can be accessed with or without the ""this"" keyword.
Overridden vs shadow If a parent method has the same name as a child method then the parent method will be overriden NOT shadowed.
What is the difference between overloading and overriding? "Overloading is when you create multiple methods with the EXACT same name BUT different implementations. Overriding is when you create a NEW implementation for an inherited method.
How to overload a method To overload the method you must change the parameter list of the new signature in one of the following ways: change the data types, change the number of parameter, OR change the order of the parameter datatypes.
How to override a method Overriding is only able to happen if we have inheritance. To override just make sure the create a method as a method in the parent class; if you've done that then the parent method's logic will be altered to the child logic
What is compile time polymorphism? "Compile time polymorphism is method overloading. It is compile time because the compiler can tell which method you're calling before the code is ever run. This is possible because it only needs to check the method signatures
What is runtime polymorphism? Runtime polymorphism is method overriding AND type casting. It is runtime because the compiler cannot definitely say what type of object will be in the heap when the operation triggers; it has to wait until a heap exists to check a heap.
What is type casting? "Type casting is when you tell java to change one data type of another. For exampe, you could tell java too change an int to a double: int myInt = 8; double myDoub = (double) myInt;"
What is the difference between up and down casting? "Downcasting turns the reference variable of an object into a reference to a child, or grandchild, or great grandchild, or etc. Upcasting turns the reference variable off an oobject into a reference to a parent, or grandparent, or etc."
What is a wrapper class? A wrapper class is a reference type (class) version of a primitive data type. They add functionality to an primitive type. the wrapper class has added functionality (methods, etc) to the primitive
What is autoboxing? "If at any point in your program, the compiler is looking for a primitive type and it is given its wrapper class variation then the compiler will automatically turn the wrapper class into the primitive variation. This is called autoboxing.
What is unboxing? The opposite is also true; if the compiler is looking for a wrapper class and you give it a primitve type then the compiler will automatically turn the primitive into its wrapper class variation. This is called unboxing."
What is a String? "A class that is implemented using an array of chars; one could think of it as a wrapper class for an array of chars. A String is immutable meaning it cannot be changed.
What is the difference betwen String, StringBuilder, and StringBuffer? "String is a class implemented using an immutable array of chars. StringBuilder and StringBuffer are mutable (they CAN be changed). Unlike StringBuilder, StringBuffer is thread safe."
Explain the principles of the SOLID acronym - O Open-closed principle "Software entities ... should be open for extension, but closed for modification."[7] Interfaces and abstractions
Explain the principles of the SOLID acronym - L Listov Liskov substitution principle "Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it."[8] See also design by contract.[8]
Explain the principles of the SOLID acronym - I Interface segregation principle "Many client-specific interfaces are better than one general-purpose interface."
Explain the principles of the SOLID acronym - D Dependency inversion principle "Depend upon abstractions, [not] concretions."
What is the difference between final, access modifier
.finalize(), method
and finally? try-catch
Explain throw create custom exception
vs throws used to declare exceptions that can occur during the execution of a program
vs Throwable superclass of all errors and exceptions in the Java language.
Do you need a catch block? Can you have more than 1? Is there an order to follow? no yes specific to general
What is base class of all exceptions? Throwable
What interface do all implement? methods
List some checked and unchecked exceptions? IOException SQLException ArithmeticException IndexOutOfBoundsException
What are functional interfaces? List some that come with the JRE for Java 8 contains only one abstract method java.util.function Consumer<T> Supplier<T>
How to make numbers in your code more readable? underscores
If 2 interfaces have default methods and you implement both, what happens? both function
If 2 interfaces have the same variable names and you implement both, what happens? as long as default methods do not conflict, implement fine
Which sequence of commands will compile and run a Java program javac HelloWorld.java java HelloWorld
When will the block after "else" execute? boolean b = getBooleanValue(); if (b) { foo(); } else { bar(); } Only when the "getBooleanValue" method returns false
An object is a(n) ______ of a class Instance
Which is true of variables in Java? Variables cannot change type once declared
Which of the following is NOT true about constructors? a constructor always returns a boolean which determines if the class was successfully instantiated
What is a wrapper class? a class that represents a primitive
What is the purpose of a package in Java? to organize classes, interfaces, and enums logically
A parameter is a ______ that is passed into a _____ and declared in the ______. variable; package; class
You are working on an application that throws an exception when it runs. What should be your first step to debug the issue? read the stacktrace from the exception
Specify the order of the steps in the software development lifecycle analysis design planning development testing deployment maintenance
Which of the following is the core difference between the Agile and Waterfall methodologies of software development? Agile is an iterative style and adapts well to change; Waterfall follows a rigid planned schedule
what is the purpose of package in Java? to organize classes, interfaces, and enums logically
A parameter is a < > that is passed into a < > and declared in the < > variable; package; class
You are working on an application that throws an exception. read the stacktrace from the exception
What is true about Java Garbage Collection? We cannot force Java Garbage Collection
Creating many objects while not allowing any to be cleaned up by garbage collection will create a memory leak and may eventually result in OutOfMemoryError
Which of these code snippets creates a scanner which can read input from the command line? Scanner sc = new Scanner(System.in);
Autocloneable - In order to use try-with-resources, which interface does the resource need to implement? AutoCloseable
What is true of variables in Java? variables cannot change type once declared
An object is a(n) < > of a class instance
What is a wrapper class? a class that represents a primitive
What is the purpose of a package in Java? to organize classes, interfaces, and enums logically
A parameter is a < > that is passed into a < > and declared in the < > variable; package; class
You are working on an application that throws an exception when it runs. First step? read the stacktrace from the exception
Creating many objects while not allowing any to be cleaned up by garbage collection will create a memory leak and may eventually result in: OutOfMemoryError
Which of these code snippets creates a scanner which can read input from the command line? Scanner sc = new Scanner(System.in);
Assuming a method contains code which may raise an Exception (but not a RunTime Exception), what is the correct way for the method to indicate that it expects the caller to handle that exception? throws Exception
An unchecked exception must be dealt with a try/catch block false handling an unchecked Throwable is optional
RuntimeException and its subclasses are checked exceptions false
The @Test annotation tells JUnit that the public void method to which it is attached can be run as a test case true The @Test annotation tells JUnit that the public void method to which it is attached can be run as a test case
Which of the following is true about JUnit? JUnit is a unit testing framework
What is unit testing? Testing the smallest, individual components of the application in isolation from the rest of the system
Which of the following method of Assert class checks that two primitives/Objects are equal? void assertEquals(boolean expected, boolean actual) checks that two primitives/Objects are equal
The do-while statement will never execute if it's conditional check is false false always execute at least once
class members marked "private" can be accessed by classes outside of the package false "private" means the member is only accessible with the same class, and is not externally available at all
What is a constructor? A special method called at instantiation, used to create an object and initialize variables
If you write a constructor, the compiler will still give you a default, no-argument constructor false
A class can be abstract, even if all of its methods are concrete true
Protected data can can be accessed only by classes in the same package, or subclasses
Abstract classes are made to be extended not instantiated
Mapping with annotations requires you to identify the mapped classes in your configuration document true
Mapping annotations are exclusive - an annotated method will only be accessible to request sent to a matching URL, with no partial matches true
The @Override annotation Tells the compiler that the method is intended to override a superclass method
Which of these is the symbol for an annotation? @
Annotations are used to provide extra information to the Java compiler true
The Object reference can be used to polymorphically store a reference to an instance of any class in Java true
What is the purpose of the hashcode() method? To provide a unique identifier for an instance of an object
Can you catch a Error? Yes, but you should not - an application can rarely handle them properly, or continue running after they occur
Should you catch all Throwable objects? No, Errors are Throwable, and should not be caught
Which exception will be thrown from this code? int[] a = new int[0]; int[] a = new int[0]; System.out.println(a[1/0]); ArithmeticException
the following code statement is valid while(true) { } true
The subclass of an abstract class cannot be abstract false
A final class cannot be instantiated false
Static methods can be called without instantiating the class first true
A class without a properly defined main() method may be executed directly false
Interface implementation is a form of inheritance true
The main() method must be static, in order to be executed by the JVM true
An interface can extend more than one interface true
Which one of following is a valid class declaration? class example implements Serializable, Runnable
What is the standard signature for the main method? public static void main(String args[])
The key word "static" means something belongs to the class and is globally available to all instances
What is a reserved word, or keyword? A word used by the JVM to represent an instruction
Java can be run on any machine that has a JVM true
It's possible to create an object for an abstract class. FALSE
Which of the following is true when an abstract class implements an Interface? The abstract class does not need to override all the methods of the interface.
What members are allowed in an abstract class? All of the above Abstract Method Non-Abstract Method. Constructor
When do we use Interface? All of the above When classes are not related, they have the same methods but different implementations When behaviour is specified but the implementation of the behaviour can be altered. To implement Multiple Inheritance of value.
_______ is the process of hiding certain details and showing only essential information to the user. Abstraction
______ is creating a class with related fields and methods and hiding the fields and methods from the rest of the world. Encapsulation
Which of the following can be declared private? Nested Class
What is the implicit superclass for all java classes? object
What are the benefits of using Objects? All of the above Modularity Information Hiding Code-reusability
Variables declared in an interface are? Default or public, static
By setting all the references to object as null, the object is eligible for _______. Garbage collection
An immutable class can be created by All of the above Declaring class as final to avoid inheritance. Initializing data using a parameterized constructor. Retrieving data using a getter method to avoid getting direct access to the object reference.
main() method is a static method and static methods can't be overriden. true
It is possible to override the static method of an interface. true
______ methods are introduced in java 8 and are added to integrate helper methods into the interface instead of creating a new class and facing cohesion issues. static
It is possible to create an Object for the Interface. false
What methods can be created in an Interface? All the above Abstract Static Default
Which access modifier is used to override the method of an Interface? public
Inner classes have access to private members of the outer class. true
An _______ class can directly access all the fields and methods of the enclosed class even if they are private. inner
The conversion of Object to primitive datatype is called Unboxing. true
Wrapper classes are immutable. true
T / F Wrapper classes are used to store data in collections and as a developer one doesn't wish that all the values in a collection are changed just because a primitive value is changed. true
T / F The automatic conversion of primitive data types into its equivalent Wrapper type is known as boxing and opposite operation is known as unboxing. true
We can do typecasting for primitive type. For primitive types we have values being wither widen or narrow depending upon source and destination data type.
We can do typecasting for reference type. For reference types, type casting make sense only when there is inheritance relationship exist between the source and destination type, in that case we say upcasting (child object casted to parent) or downcasting(parent object casted to child).
What is typecasting? Type casting is the process of changing variable from one datatype to another datatype. Type casting is possible for both primitive and reference type.
The process of changing from smaller datatype to larger datatype is called Widening casting. Explanation : Widening casting also called implicit type casting is the process changing from smaller datatype to larger datatype. The conversion is done automatically
The % operator Returns the remainder of dividing the left operand by the right
What is the difference between the = and == operators? the = operator is assignment, the == operator tests equality
which operator returns true if the left operand is an object that is an instance of the right operand class? instanceof
What is the purpose of the Java compiler? to transform Java code into instructions usable by the JVM
Which of the following are wrapper classes? Boolean Long Double Short
Which of the following are true about Java? Object oriented Write once run anywhere Java programs cannot control thread scheduling Java has an API to inspect and manipulate its own code at runtime
The Finalize method can be overriden true
If a class defines a main method and a static block, the static block will execute first true
the changes to the instance variables of one object also have an effect on the instance variables of the other object false
the try-finally block is legal and does not require a catch block true
Sums up all integers less than 100 in array try{ while(values[i]<100) { sum = sum+values[i]; i++;} } catch(Exception e) { } user ArrayIndexOutOfBoundsException for catch and add code in catch block to log or print the exception use flow control to terminate the loop
How to get the size of an array? myArray.length
In < > package does the Date Time API reside in Java 8? java.time package
What are the classes used in Date and Time API in Java 8? LocalDateTime, ZonedDateTime LocalDateTime is the class in the date-time API when there is no complexity in time zone handling. ZonedDateTime is also a class n the date-time API used to deal with various time zones
< > can be used when there is no need for time zones LocalDateTime
ZonedDateTime API is used < >. when we are considering time zones
To define an amount of time with date-based values (years, months, days), use the < > class Period
Which class measured an amount of time using time-based values (seconds, nanoseconds)? Duration
Which is the following syntax helps to get the current time? ZonedTime zt = ZonedTime.now();
Time-zone offset is measured in fixed number of < > and < > hours and minutes
Which is the correct syntax to print the current date and time in Java 8? LocalTime currentTime = LocalTime.now(); LocalDate currentDate = LocalDate.now(); LocalDateTime currentDateTime = LocalDateTime.now();
What is wrong with this code example? public static int main(String args[]) main() method returns an int
Which are valid ways to declare an array? public int[] myArray = new int[3]; public []int myArray = new int[3]; public int myArray[] = new int[3];
True or False: class members marked “private” can be accessed by classes outside of the package. false
True or False: If you write a constructor, the compiler will still give you a default, no-argument constructor. false
public class Question { public void doThing() { } public static void main(String[] args) { doThing(); } } The doThing() method must be declared static to be used in main()
A class can be abstract, even if all of this methods are concrete true
Interfaces are a form of inheritance false
You should catch errors where possible false
Interfaces are a form of inheritance false
The equals() method is equivalent to the == operator, unless overridden true
True or False: the following code is valid? public class Question { public static void myMethod(Object o) { } public static void main(String[] args) { myMethod(new String(“Test”)); } } true
Protected data can… Can be accessed only by classes in the same package, or subclasses
True or False: Data given no access modifier can only be accessed within the same class in which it is declared false
True or False: Mapping with annotations requires you to identify the mapped classes in you configuration document true
True or False: Annotations are used to provide extra information to the Java compiler true
Which of these is a valid location for an annotation in Java 8? All of these Before a class declaration Before the use of a type Before a method declaration
True or False: clone() creates a new instance of an object with all the properties initialized to the same values true
True or False: A finally block will execute regardless of whether an exception is caught true
Given the command line argument in quotes “1 2 3” what will be the output of the following code? public static void main(String[] args) { for (String temp: args) { System.out.print(temp); } } 1 2 3
classloader an abstract class responsible for loading classes
what are the Object thread methods? public final void notify() public final void notifyAll() public final void wait() public final void wait(long timeout) public final void wait(long timeout, int nanos)
Arrays() double-brace initialization technique Set<String> set = Collections.unmodifiableSet(new HashSet<String>() {{ add("foo"); add("bar"); add("baz"); }}); .collect(collectingAndThen(toSet(), Collections::unmodifiableSet));
Arrays() Stream Stream.of("foo", "bar", "baz") .collect(collectingAndThen(toSet(), Collections::unmodifiableSet));
Created by: wahoo99
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards