Chapter I Flashcards

- Understanding java technology and environment - Creating a simple java program - Describing and using objects and classes

1
Q

What are the key (identifying) benefits of Java

A
  • Object-Oriented
  • Encapsulation
  • Platform independent
  • Robust
  • Simple
  • Secure
  • Multithreaded
  • Backward Compatibility
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

An Object is a runtime instance of a class in memory

A

Yes

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

A reference is

A

A variable that points to an object

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

Methods and fields are

A

Called the members of the class

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

The method name and parameter types are called

A

The method signature

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

Main method signature

A

public static void main (String[] args){}
public static void main (String… args){}
public static void main (String options[]){}

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

Each file can contain how many public class

A

Only one public class

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

public, private are

A

Access modifier

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

varargs is

A

variable argument lists

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

Compile command

A

javac -d classes packagea/ClassA.java packageb/ClassB.java

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

Run command

A

java -cp classes packageb.ClassB
java -classpath classes packageb.ClassB
java –class-path classes packageb.ClassB

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

Create a jar command

A

jar -cvf myNewFile.jar .
jar –create –verbose –file myNewFile.jar .
jar -cvf myNewFile.jar -C dir .

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