Java Full Stack

Ace your homework & exams now with Quizwiz!

The value that is used on either side of an operator is called:

operand

What are the common numeric operators in Java?

+,-,*,/,%

Can a String be changed once it is created?

A string cannot be changed once it has been created

What is an iterator in Java?

An iterator is an object that allows for cycling through a collection to obtain or remove elements.

Who invented Java?

James Gosling at Sun Microsystems

Map keys will contain what?

Map keys will contain unique keys

What are variables in Java?

Variables in Java are used for storing data for processing

Does the LinkedHashSet maintains the insertion order or permit null elements?

Yes

What are some methods in the list interface?

.add() .remove() .get()

What is the latest version of Java in 2020?

16

How many primitive data types are they in Java?

8

What are breakpoints when using a debugger? ​

A breakpoint allows for stopping the program execution at certain points. Breakpoints can be set by hovering the mouse over the editor's gutter area and clicking on it. The breakpoint will be identified by red circle symbols. To remove the break point you will just click on the red circle symbol

What is a class in Java?

A class in java is the user defined blue print with fields and methods

Collections in Java is a framework that provides an architecture to store and manipulate what?

A group of objects

What is a String in Java?

A sequence of characters in Java

In java is a string mutable?

A string is not a mutable object

What will a while loop statement allow in Java?

A while loop statement will repeatedly execute a target statement as log as a given condition is true

What is a array literal used for in java?

An array literal is used for creating arrays of primitive types and strings when you have what the values are you are wanting to insert

An if statement can contain how many else if statements?

As many as you want

What is class cast exception? ​

Class cast exception is an exception which occurs at run time when an object of one type cannot be casted to another type

Can you explain the inspecting variables action with debugger?

During debugging, IntelliJ shows you the value of the variable in the editor window. You can even also view the same information in the debug window

In a switch statement what is each value called?

Each value is called a case

What are collections in Java?

In java collections is a framework that has a set of classes and interfaces that implement commonly reusable collection data structures

In order to create your own objects in Java what do you have to have?

In java you must have a user defined class that you can instantiate to create an object

Can you explain the IntelliJ Debugger?

IntelliJ provides an inbuilt Java debugger. It allows for stopping the execution of a program at certain points, inspect variables, and step into functions/methods to see what the program is doing

What are the classes in the List interface?

List<data-type> list1=new ArrayList(); List<data-type> list2=new LinkedList(); List<data-type> list3=new Vector(); List<data-type> list4=new Stack();

What is narrowing as it pertains to typecasting?

Narrowing is converting a larger datatype to a smaller datatype. In this case the casting/conversion is not done automatically. You will need to convert the data type using the following syntax (<data-type>) explicitly, where this must be on the left-hand side of the datatype being converted. When using this syntactic construct this is known as explicit typecasting or type conversion

WIll the set interface allow duplicate values?

No

What are the types of casting?

Primitive casting: when the data is casted from one to primitive type like int, float, double to another primitive type. This is called primitive casting. Derived casting: when the data is casted from one derived type to another derived type, then it is called to derived casting. In other words when one is casting from one object to another object.

What are primitive data types in Java?

Primitive types are the most basic data types available within the Java language

Which is the correct representation of a String literal?

String word="ehlow";

Why do we need Strings in Java?

Strings in Java are one of the most used data types in Java. They allow users to be able to store anything in them.

The ArrayList class implements what interface?

The ArrayList class implements that list interface

The HashSet class implements what interface?

The HashSet class implements the set interface.

What table does the HashSet use for storage?

The HashSet uses the hash table for storage.

HashSet will contain what?

The HashSet will contain unique items

The Java HashMap class implements what interface?

The Java HashMap implements the Map interface

What can you achieve through using the Java collections framework?

The Java collections framework can achieve all the operations that you will normally perform on data such as searching, sorting, insertion, manipulation, and deletion

In java when creating a class the class name and what else has to be the same?

The Java file which contains the class has to have the same name as the class

The LinkedHashSet can contain what?

The LinkedHashSet can contain unique elements.

The LinkedHashSet class represents what?

The LinkedHashSet class represents the LinkedList implementation of the set interface. It extends the HashSet class and implements the Set interface

What interface does the LinkedList implement?

The LinkedList class implements the List interface

What is the list interface?

The List interface will allow you to be able to work with a list data type structure in which you can store an ordered collection of objects. it can also have duplicate values

What are the attributes in a class?

The attributes are the variables or fields within a class

When is the best time to use a for loop?

The best time to use a for loop is when the starting and ending numbers are known

In a while loop when the expression is tested and the result checked to be false what will happen? ​

The body of the loop is skipped and the first statement after the while loop is executed

What will happen when a switch statement encounters a break statement?

The break statement can be used to exit out of the switch statement

What is the condition in a for loop used for?

The condition in a for loop is evaluated each time the loop iterates. the loop executes the statement repeatedly until the condition return false

Can you explain the evaluate expression action with debugger? ​

The evaluate expression will allow you to evaluate an expression on the fly. You can do the following step to evaluate an expression in the IntelliJ debugger: 1. Start the application in debugger 2. Navigate to Run->Evaluate expression 3. Enter the expression

What is the enhanced for loop used for?

The for each loop is used to traverse the elements in an array

What will the for loop allow you to do?

The for loop allows you to be able to write loops that will execute a specific number of time

What will the hasnext() method do?

The hasNext() method will return true if there is a least one more element

What is the initialization in a for loop used for?

The initialization in a for loop is the expression that will execute only once during the beginning of the loop

What does the LinkedList use internally to store the elements.

The linkedList uses a doubly linked list to store elements

The map contains values on what basis?

The map contains values on the basis of key and value pairs

In Java Object-Oriented Programming is a style that is intended to put programmers in the mindset of what?

The real world

Can you explain the resume program action with a debugger?

The resume program action will continue the execution of a program by ignoring all the breakpoints

The set interface is part of the Java collection framework that cannot contain what?

The set interface cannot contain duplicate elements

Can you explain the step over action with a debugger?

The step over action does not enter into a function instead, it will jump to the next line of code. For instance, if you are at line 9 and execute the step over action then it will move the execution to line 10

Why does Java support automatic type casting of integers to floating points?

This is because there is no loss of precision

When it comes to arrays what does it mean that they are zero based?

When accessing an element in an array you will have to start with the index 0 because arrays are zero based. This means that instead of counting the indexes 1 2 3 4. You will count them as 0 1 2 3

When is a map useful?

When you have to search, update, delete, elements based on a key

Can you explain the smart step into action with a debugger?

While debugging, you may sometimes reach a line of code that calls several methods. When debugging these lines of code, the debugger typically allows you to use step into and leads you through all child functions and then back to the parent function. However, what if we only wanted to step into one child function? With Smart step-into, it allows you to choose the function to step into

What is widening as it pertains to typecasting?

Widening is converting a smaller datatype to a larger datatype. In this case the cast/conversion is done automatically therefore, it is known as implicit type casting. In this case both datatypes should be compatible with each other

What is auto widening and explicit narrowing?

Widening: The data is implicitly casted from a smaller primitive type to larger primitive type. This is called auto-widening. The data is automatically casted from byte to short. sort to int, int to long. and float to double. Narrowing: You must explicitly cast the data from a larger primitive type to a smaller primitive type. You will have to convert the data from double to float, long to int, int to short and short to byte. This is called explicit narrowing.

What is boxing and unboxing?

Wrapping a primitive type into the corresponding wrapper class is called boxing. Unwrapping is when the runtime retrieves the privative datatype from the wrapper class. This is also known as unboxing

Is the if statement on of the most frequently used conditional statements in java?

Yes

Will a LinkedList maintain insertion order?

Yes

Is String in Java a class?

Yes, String in java is a class that has its on methods.

An array is

a collection of variables of the same type.

What is the Java Runtime Environment (JRE)?

a software layer that runs on top of a computer's operating system software and provides the class libraries and other resources that a specific Java program needs to run

What are some key points to remember about HashMaps?

contains values based on the key. contains only unique keys. may have one null key and multiple null values. maintains no order.

The ArrayList uses a dynamic array to store...

duplicate elements of different data types

What is the enhanced for loop sometimes called?

for each loop

What methods does the iterator class provide?

hasNext() next() remove()

In Object-Oriented programming each object has what three dimensions?

identity, attributes, behavior

What is the correct import to use the Scanner class?

import java.util.Scanner;

In an array, the elements are ordered and each has a specific and constant position, which is called?

index

What are the primitive data types in Java?

int, double, float, char, boolean, short, long, byte

Which is the correct way to declare an integer array in Java?

int[] array;

The ArrayList class...

maintains the insertion order and is non-synchronized

What are the two forms that can be used with the increment and decrement operator?

prefix and postfix

A switch statement will...

test a variable for equality against a list of values

What is the Java Development Kit (JDK) in Java?

the java development kit that is used to build the applications that will run on the JRE

In every executable Java Program...

there must be a method called main

In down casting can you cast an object of a super class to its subclass?

yes

What makes a do while loop different from a while loop?

​ A do while loop is guaranteed to execute the body of the loop at least once before the condition is checked

What is debugging in Software Development?

​ Debugging refers to identifying, analyzing, and removing errors in a program

Can you explain the step into action with a debugger?

​ While in debugger mode if you have a breakpoint placed in front of a method the application will stop when it gets to the breakpoint before the method. At that time, you can select the step into tab that is part of the debugger to step through each line of the method and you will continue stepping through each line of code for the rest of the program

What are conditional statements used for?

Conditional statements are used to perform different actions based on different conditions

Is java a fully Object-Oriented Programming language?

No

What are the classes in the set interface?

Set<data-type> s1=new HashSet<data-type>(); Set<data-type> s1=new LinkedHashSet<data-type>(); Set<data-type> s1=new TreeSet<data-type>();

What does the increment or decrement operator provide?

The increment and decrement operator provides a more convenient and compact way to increase or decrease the value of a variable by one

In a for loop what is the increment/decrement used for?

The increment/decrement will execute after each iteration of the loop

Can you explain the step out action with a debugger?

The step out action is the same as the step into action. The key is that if you place the breakpoint in front of the method you are wanting to debug the application will stop. At that point you can use the step into to step through each line of code for the method and when you are done you can use the step out action to resume the normal flow of the program

What are logical operators used for?

To combine multiple conditions

When you change a value of one type to another type it is known as?

Type Casting

When is type casting mandatory?

Type casting is mandatory when assigning floating point values to integer variables

What is type casting?

Type casting is when you convert one primitive datatype into another type casting (type conversion) in Java. You can cast primitive datatypes to another primitive datatype the datatype will be either widening or narrowed

Why is up casting automatic and down casting manual?

Up casting can never fail. But if you have a group of different Animals and want to downcast them all to a Cat, then there's a chance that some of these Animals are actually Dogs, so the process fails.


Related study sets

Domain I: Creating Works of Art- Orange Cards

View Set

MCB3020 Bacusmo Final Exam (Cumulative)

View Set

soci ch. 15 families and intimate relationships

View Set

Sections 7, 8, and 9 Practice Quiz Questions

View Set