Home » , » Download PDF Learning Java Through Games by Lubomir Stanchev

Download PDF Learning Java Through Games by Lubomir Stanchev


Sinopsis

Computers are electronic devices that can perform calculations. The first electronic digital computer was built by physics professor John Atanasoff and his graduate student Clifford Berry in 1937. The computer could not be programmed and could be used only to solve linear equations. Six years later, in 1943, the first programmable electronic computer was built by Tommy Flowers; see Figure 1.1.

As you can see in the picture, the first computers took a lot of space. Different components, such as secondary storage and main memory, were in separate racks. Early computers could easily fill a present-day classroom. Colloquial expressions such as: “I will go to check on the memory” were common in those days. Even the term “bug”, which is commonly used to describe a software error, derives from the days when actual rodents were roaming around the different components of a computer. As time progressed, computers became smaller and cheaper. The personal computer was introduced in the late 1970s and early 1980s by the likes of Hewlett Packard, Apple, and IBM.

Software is usually written by software programmers using a programming language, such as Java or C. It is then converted into binary code that the CPU can understand. A compiler will directly translate the program code into binary (or executable) code, which can be later executed. For example, in Windows executable files have the extension .exe. Conversely, an interpreter interprets the program. It translates every line of code into executable code, which is then executed. A file that contains the executable code is not created. An interpreter is usually slower than a compiler because each line of code needs to be translated into executable code before it can be executed.

Java takes an approach that uses both a compiler and interpreter. Java code is compiled into Java binary code, which is different than the binary code that the CPU can understand. This binary code can be later executed by a Java Virtual Machine (JVM) interpreter. This is the reason why Java programs can run slower than programs that are directly compiled, such as programs written in the C programming language. Alternatively, the Java Virtual Machine may be physically coded as part of the CPU. For example, some cell phones have CPUs that can execute Java binary code.

There are two general types of software: operating system software and application software. Operating systems software provides the interface between the hardware of the computer and the application software. For example, the operating system of a computer allows programs to access input and output devices, such as the keyboard, the hard disk, the mouse, and the monitor. Most modern operating systems also provide Graphical User Interface (GUI) to the system. A different responsibility of the operating system is to allow programs to execute concurrently and share resources, such as the main memory and the hard disk. The application software in a computer is made up of the programs that are run by the end users. These include games, office software, and web browsers.

Computer software can be written using different programming languages. A programming language of first generation is machine code. To put it differently, this is a sequence of zeros and ones that the computer can understand. Such code can be represented, for example, in hexadecimal notation. A typical example of a machine instruction is to read data that is stored in a location of main memory. The problem with machine code is that it is low level and it is difficult for humans to interpret. A second-generation programming language is referred to as Assembly language. Now the instructions are written using English words (e.g., add, sub, move, etc.). There is a straightforward mapping between code written in an Assembly language and machine code. The disadvantage of Assembly is that it is a very low level language and writing Assembly code is difficult. A third-generation programming language provides high-level access to the data. Examples of third-generation programming languages include C, C++, and Java.

Content 

  1. Computer Hardware and Software
  2. Data Types and Conditional Statements
  3. Loops
  4. Methods and Formatted Output
  5. Introduction to Arrays
  6. Introduction to Classes
  7. The ArrayList Class and the enum Keyword
  8. Classes Revisited
  9. Fun with Swing
  10. Nested Classes and Event Handling
  11. The Breakout Game (Complete Version)
  12. Layout Management and GUI Components
  13. Exception Handling and Files
  14. Recursion
  15. Java Applets



0 komentar:

Posting Komentar