Java Tutorial for Beginners - YT Flashcards

1
Q

What is a function?

A

A block of code that performs a task

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

What is a class?

A

It is a container with one more related functions. It used to organize our code.

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

What is a method?

A

A method is a function that is part of a class

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

What naming convention do you use to name a class?

A

PascalNamingConvention

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

What naming convention do you use to name a method?

A

camelNamingConvention

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

What happens under the hood the moment we run a Java program in IntelliJ?

A

There are basically two steps involved. Compilation and Execution.
Compilation step, it uses the Java Compiler to compile our code into a different format called Java bytecode.

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

What is name of the “age” in this example?
int age = 30;

A

Identifier because it is used to identify our variable

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

What is the equal sign called?

int age = 30;

A

Assignment operator

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

What is 30 called in this example?

int age = 30;

A

Initial value

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

What are primitive types used for?

A

They are used for storing simple values

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

What are reference types used for?

A

They are used for storing complex objects.

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

Reference types are copied by what?

A

Their references

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

Primitive types are copied by their what?

A

Their value which are completely independent of each other

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

TRUE OR FALSE:
Strings are not reference types in Java

A

FALSE
They actually are. They look like primitive types but they aren’t

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

What is the difference between arguments and parameters?

A

Parameters are the holes that we define in our methods, arguments are the actual values that we pass to the methods

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

TRUE OR FALSE:
In Java, Strings are immutable

A

TRUE! They can’t be changed.

17
Q

Do arrays have a fixed length?

A

Yes they do!