Exam 1 Flashcards
(100 cards)
Java is a fully ___.
Object-oriented language
High-level languages
Python/Java -meant for humans
Machine code
Low-level code that can be executed on a computer
Bytecode
Between high and low level code-easier to interpret into machine instructions
Interprets bytecode into machine code
Virtual machine -different ones needed for different OS
All Java programs require ___
Scaffolding -all code must be in body of a class
Static
Marks a method or field as belonging to the class it’s in -can be accessed without creating an object
Public
Accessible from anywhere outside the class
All strings must be enclosed in ___
Double-quotes
Maven
Organizers, compiles, and runs code.
Manages third-party dependencies by downloading from Internet
Java is a ___ typed language
Statically
To create a long or float (instead of int or double)
Add l or f to end of number
Primitive types
Integers, floats, characters, booleans
Reference types
Strings, arrays, objects
T/F: Any type can be concatenated to a string
True, using +
Result of arithmetic operators using both an int and a float
Float -more complex type
T/F: Strings are iterable
False
Also can’t use []. Must use charAt(int index) to find char
T/F: Java supports negative indexes
False. Index from 0 to length - 1
String literal pool
If same string literal used in multiple places, single copy stored and reused
All functions in Java are __
Methods
Assigning the return value of a void method to a variable results in a ___
Compiler error
T/F: A void method can return an empty (return;)
True
Except for void methods, all branches of a method must terminate with a ___ statement
Return
Structure of a for statement
Initialization -executed exactly once
Boolean expression - evaluated before each iteration
Modification statement -executed after each iteration