26
Java Chapter 1 Review Names & Identifiers Errors & Binary #’s Hardware & Networks Misc. I Misc. II 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50

Java Chapter 1 Review

  • Upload
    ceana

  • View
    67

  • Download
    0

Embed Size (px)

DESCRIPTION

Java Chapter 1 Review. How does Java handle identifiers that are the same word but typed in upper or lower case? 10 points. They are considered different identifiers because Java is case-sensitive. What is the relationship of the file name and the class identifier name? 20 points. - PowerPoint PPT Presentation

Citation preview

Page 1: Java Chapter 1 Review

Java Chapter 1 ReviewNames &

IdentifiersErrors &

Binary #’sHardware & Networks

Misc. I Misc. II

10 10 10 10 10

20 20 20 20 20

30 30 30 30 30

40 40 40 40 40

50 50 50 50 50

Page 2: Java Chapter 1 Review

How does Java handle identifiers that are the same word but typed in upper or lower case?10 points

They are considered different identifiers because Java is case-sensitive.

Page 3: Java Chapter 1 Review

What is the relationship of the file name and the class identifier name?20 points

The two names must be the exact same in order to compile and run properly.

Page 4: Java Chapter 1 Review

Is the following identifier legal, if no then why?$_totalPrice230 points

This identifier is just fine.

Page 5: Java Chapter 1 Review

Is the following identifier legal, if no then why?strFirst&Last_Name 40 points

This identifier is bad because it uses the & symbol and that is not allowed.

Page 6: Java Chapter 1 Review

What are all the rules for creating identifiers in the Java language?50 points

Any combination of letters, digits, the underscore and the dollar sign are allowed but the first character can’t start with a digit.

Page 7: Java Chapter 1 Review

Convert the Base 2 number 1001 0011 to a Base 10 number without electronic help.10 points

Base 10 = 147

Page 8: Java Chapter 1 Review

Convert the Base 10 number 193 to a Base 2 number without electronic help.20 points

Base 2 = 1100 0001

Page 9: Java Chapter 1 Review

What are the three types of programming errors and explain each of the three.30 points

Compile – A syntax error, can’t compile.

Run-Time – Program compiles, but crashes when it runs.

Logic error- Output is not what is expected

Page 10: Java Chapter 1 Review

List the error(s) & there type in the following code.

/*This programs adds two numbers together/*public class junk { public static void maine(String args[]) answer = 1number / 2number; System.out.println("The answer is); system.out.println(answer) }//end of maine method}/end of junk class40 points

Multiple line comment is wrong, main is spelled wrong, missing { for main, identifier is wrong, / instead of +, missing “ mark, missing ;

Page 11: Java Chapter 1 Review

List how many unique items can be created with a 5 bit number.50 points

25 = 32

Page 12: Java Chapter 1 Review

Temporary holding location for data while programs are running. Data is lost once computer is shut down.10 points

What is RAM

Page 13: Java Chapter 1 Review

A group of computers that is networked together in a generally small area.20 points

What is a LAN

Page 14: Java Chapter 1 Review

List a unit of measurement that is used for comparing each of the following devices.RAM – Hard Drive –CPU –Monitor -30 points

RAM, Hard Drive – Bytes

CPU – Hertz

Monitor – Inches on the diagonal

Page 15: Java Chapter 1 Review

List three devices that hold data even after a computer is shutdown and that are referred to as secondary memory devices.40 points

Hard drive, USB key, CD, DVD, Tape, Floppy etc…

Page 16: Java Chapter 1 Review

The dominate protocol that is used in networks that allow computers to communicate with each other.50 points

TCP/IP

Page 17: Java Chapter 1 Review

What two components come with the Java SE version 6 and what is their general function?10 points

The JRE – The Java Runtime Environment, the virtual computer that allows your program to run on whatever system it is installed on.

The JDK – The Java Development Kit, allows you to compile Java programs.

Page 18: Java Chapter 1 Review

Explain the difference between the following two files and explain how each was created.MyProgram.javaMyProgram.class20 points

The .java file is the edit file and has the source code created in some editor.

The .class file is the bytecode and was created by javac’ing the .java file.

Page 19: Java Chapter 1 Review

Why don’t you have to compile a Java program differently for each computer system?30 points

Java is architectural neutral, the JRE takes the code and translate it to work for whatever system the JRE is installed on.

Page 20: Java Chapter 1 Review

Convert 356,000 KB to each of the following:Bytes:GB:MB:40 points

356,000,000 Bytes

.356 Gbytes

356 MBytes

Page 21: Java Chapter 1 Review

What is a method?50 points

A method is like a VB procedure or function, and is collection of programs statements that is given a name that can be called and executed.

Page 22: Java Chapter 1 Review

How do you create single line comments and multiple line comments in Java?10 points

For single line use //

For multiple line use /* blah */

Page 23: Java Chapter 1 Review

What are reserved words in Java?20 points

Words that are used in the syntax of the Java language. Java commands. You are not allowed to use these words as identifiers.

Page 24: Java Chapter 1 Review

A Java application can contain multiple classes, but exactly one of the classes must contain what method?30 points

The main method

Page 25: Java Chapter 1 Review

How much information does one address of RAM hold?40 points

One Byte

Page 26: Java Chapter 1 Review

What is the term we used for proper indentation and spacing out your code?50 points

What is white space.