2024年4月14日发(作者:)

Chapter 1 Introduction to Computers, Programs, and Java

1.

A computer is an electronic device that stores and processes data. A computer

includes both hardware and software. In general, hardware is the physical aspect of

the computer that can be seen, and software is the invisible instructions that control

the hardware and make it work. The hardware of a computer consists of a CPU,

cache, memory, hard disk, floppy disk, monitor, printer, and communication devices.

The machine language is a set of primitive instructions built into every computer.

Assembly language is a low-level programming language in which a mnemonic is

used to represent each of the machine language instructions. The high-level

languages are English-like and easy to learn and program.

The operating system (OS) is a program that manages and controls a computer’s

activities. The examples of OS are Windows 98, NT, 2000, XP, or ME. Windows.

Application programs such as an Internet browser and a word processor run on top of

an operating system.

100 in decimal => 64 in hex

100 in decimal => 01100100 in binary

4340 in decimal => 10F4 in hex

4340 in decimal => 1 in binary

2000 in decimal => 7D0 in hex

2000 in decimal =>

5.

1000011001 in binary => 219 in hex

1000011001 in binary => 537 in decimal

2.

3.

4.

100000000 in binary => 100 in hex

100000000 in binary => 256 in decimal

100111 in binary => 27 in hex

100111 in binary => 39 in decimal

6.

FEFA9 in hex => 1044393 in decimal

FEFA9 in hex => 11111111 in binary

93 in hex => 147 in decimal

93 in hex => 10010011 in binary

2000 in hex => 8192 in decimal

7.

2000 in hex => 10 in binary

Developed by a team led by James Gosling at Sun Microsystems in 1991. Originally

called Oak, it became Java in 1995 when it was redesigned for developing Internet

applications.

Java can run on any platform with a Java Virtual Machine. The minimum requirement

is the Java Runtime Environment, free from the .

8.

9.

The input is the Java source code and the output is the Java bytecode (if compiled

successfully).

JBuilder by Borland, Sun ONE Studio by Sun, Café by WebGain, Visual Age for

Java by IBM are the tools for developing Java programs, not dialects of Java. These

tools make developing Java programs easier and more productive.

HTML is a markup language for displaying static Web pages. Java is a full-fledged

programming language that can be used to develop dynamic Web pages. The Java

programs that run from a Web browser are called applets. Java applets must be

embedded in HTML files using the tag.

Keywords have specific meaning to the compiler and cannot be used for other

purposes in the program such as variables or method names. Examples of keywords

are class, static, and void.

Java source code is case sensitive. Java keywords are always in lowercase.

The source file extension is .java and the bytecode file extension is .class.

Comments are used to document what a program is for and how a program is

constructed. Comments help the programmers or users to communicate and

understand the program. Comments are not programming statements and are ignored

by the compiler. In Java, comments are preceded by two forward slashes (//) in a line

or enclosed between /* and */ in multiple lines. When the compiler sees //, it ignores

all text after // in the same line. When it sees /*, it scans for the next */ and ignores

any text between /* and */.

10.

11.

12.

13.

14.

15. n(...);

ssageDialog(null, “Hello world”);

16.

Line 2. Main should be main.

Line 2. static is missing.

Line 3: Welcome to Java! should be enclosed inside double quotation marks.

javac is the JDK command to compile a program program. java is the JDK command

17.

to run a program.

18.

19.

Java interpreter cannot find the .class file. Make sure you placed the .class in the right

place, and invoked java command with appropriate package name.

The class does not have a main method, or the signature of the main method is

incorrect.

Thank you for evaluating AdreamSoft PDF to Word

You can only convert 3 pages with the trial version

To get all the pages converted, you need to purchase the software from

/purchase/

本文发布于:2024-04-14,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:基础程序设计习题语言答案

发布评论

评论列表(有0条评论)
    福州电脑网_福州电脑维修_福州电脑之家_福州iThome

    福州电脑网_福州电脑维修_福州电脑之家_福州iThome

    福州电脑维修网(fzithome.com)专业的电脑维修,笔记本维修,上门维修各种电脑,笔记本,平板等,快速上门.电脑知识频道内容覆盖:计算机资讯,电脑基础应用知识,各种电脑故障维修学习,电脑外设产品维修维护,病毒,软件,硬件,常识.