1 / 26

Java Chapter 1 Review

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.

ceana
Download Presentation

Java Chapter 1 Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java Chapter 1 Review

  2. 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.

  3. 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.

  4. Is the following identifier legal, if no then why?$_totalPrice2 30 points This identifier is just fine.

  5. 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.

  6. 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.

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

  8. Convert the Base 10 number 193 to a Base 2 number without electronic help. 20 points Base 2 = 1100 0001

  9. 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

  10. 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 class 40 points Multiple line comment is wrong, main is spelled wrong, missing { for main, identifier is wrong, / instead of +, missing “ mark, missing ;

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

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

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

  14. 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

  15. 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…

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

  17. 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.

  18. Explain the difference between the following two files and explain how each was created.MyProgram.java MyProgram.class 20 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.

  19. 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.

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

  21. 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.

  22. How do you create single line comments and multiple line comments in Java? 10 points For single line use  // For multiple line use  /* blah */

  23. 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.

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

  25. How much information does one address of RAM hold? 40 points One Byte

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

More Related