Chap 1 Flashcards
What does a dynamic langauge mean?
In dynamic languages, the types and values are both dynamic, which means the types and values can both be changed.
Why learn Java over C++ or C?
- Java includes a larger standard library than C or C++
- Java incorporates automatic garbage collection of memory, whereas C and C++ programs typically include some degree of manual memory management.
- C++’s syntax is more complicate than Java’s, making it more difficult to learn.
What are the benefits we get from compiling?
- Early detection of errors
- Faster program execution
what does the Java Virtual Machine do?
The Java Virtual Machine (JVM) understands byte code that has been compiled.
It is faster than pythons interpreter.
What are the important rules for running a Java program?
- Every Java program must define a class, and all code is inside a class
- Everything in Java must have a type
- Every Java program must have a function called public static void main(String[] args)
What does the static keyword mean?
static tells Java that a method is part of the class, but is not a method for any one instance of the class.
Why use primitive data types for Java?
the primitive types are much faster and require much less memory
what is the difference between a dynamically typed language vs a statically typed langauge?
- dynamically-typed languages perform type checking at runtime, while statically typed languages perform type checking at compile time.
- statically-typed languages require you to declare the data types of your variables before you use them, while dynamically-typed languages do not.
True or False: Colons are used to indicate the end of a Java statement
False. Semicolons (;) are used to indicate the end of a statement
fill in the blank: Byte code instructions are ____
read and interpreted by the JVM
a characteristic of ___is that only an object’s methods are able to directly access and make changes to an object’s data
a) classes
b) procedures
c) component reusability
d) data hiding
d) data hiding