Chap 1 Flashcards

1
Q

What does a dynamic langauge mean?

A

In dynamic languages, the types and values are both dynamic, which means the types and values can both be changed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why learn Java over C++ or C?

A
  1. Java includes a larger standard library than C or C++
  2. Java incorporates automatic garbage collection of memory, whereas C and C++ programs typically include some degree of manual memory management.
  3. C++’s syntax is more complicate than Java’s, making it more difficult to learn.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the benefits we get from compiling?

A
  • Early detection of errors
  • Faster program execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what does the Java Virtual Machine do?

A

The Java Virtual Machine (JVM) understands byte code that has been compiled.
It is faster than pythons interpreter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the important rules for running a Java program?

A
  1. Every Java program must define a class, and all code is inside a class
  2. Everything in Java must have a type
  3. Every Java program must have a function called public static void main(String[] args)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the static keyword mean?

A

static tells Java that a method is part of the class, but is not a method for any one instance of the class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why use primitive data types for Java?

A

the primitive types are much faster and require much less memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the difference between a dynamically typed language vs a statically typed langauge?

A
  1. dynamically-typed languages perform type checking at runtime, while statically typed languages perform type checking at compile time.
  2. statically-typed languages require you to declare the data types of your variables before you use them, while dynamically-typed languages do not.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: Colons are used to indicate the end of a Java statement

A

False. Semicolons (;) are used to indicate the end of a statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

fill in the blank: Byte code instructions are ____

A

read and interpreted by the JVM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

d) data hiding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly