Java For Dummies (eBook)
737 Seiten
For Dummies (Verlag)
978-1-394-28925-7 (ISBN)
Learn to code with Java and open the gate to a rewarding career
Now in its 9th edition, Java For Dummies gives you the essential tools you need to understand the programming language that 17 million software developers rely on. This beginner-friendly guide simplifies every step of the learning process. You'll learn the basics of Java and jump into writing your own programs. Along the way, you'll gain the skills you need to reuse existing code, create new objects, troubleshoot when things go wrong, and build working programs from the ground up. Java For Dummies will help you become a Java developer, even if you're brand new to the world of coding.
- Learn the basic syntax and building blocks of Java
- Begin to write your own programs in the latest Java version
- Test out your code and problem-solve any errors you find
- Discover techniques for writing code faster
This is the must-have Dummies resource for beginning programmers and students who need a step-by-step guide to getting started with Java. You'll also love this book if you're a seasoned programmer adding another language to your repertoire.
Dr. Barry Burd is a professor of Mathematics and Computer Science at Drew University in Madison, NJ. He's a co-leader of the Garden State Java User Group and New York JavaSIG. In 2020, he was honored to be named a Java Champion. He's the author of Beginning Programming with Java For Dummies and Flutter For Dummies.
Learn to code with Java and open the gate to a rewarding career Now in its 9th edition, Java For Dummies gives you the essential tools you need to understand the programming language that 17 million software developers rely on. This beginner-friendly guide simplifies every step of the learning process. You'll learn the basics of Java and jump into writing your own programs. Along the way, you'll gain the skills you need to reuse existing code, create new objects, troubleshoot when things go wrong, and build working programs from the ground up. Java For Dummies will help you become a Java developer, even if you're brand new to the world of coding. Learn the basic syntax and building blocks of Java Begin to write your own programs in the latest Java version Test out your code and problem-solve any errors you find Discover techniques for writing code faster This is the must-have Dummies resource for beginning programmers and students who need a step-by-step guide to getting started with Java. You'll also love this book if you're a seasoned programmer adding another language to your repertoire.
Chapter 1
All about Java
IN THIS CHAPTER
What Java is
Where Java came from
Why Java is so cool
Three ways to write computer code
Say what you want about computers. As far as I’m concerned, computers are good for just two simple reasons:
-
When computers do work, they feel no resistance, no stress, no boredom, and no fatigue. Your computer can work 24/7 making calculations for
www.climateprediction.net— a distributed computing project to model the world's climate change. Or, have your computer crunch numbers forRosetta@home— a site that models proteins to help cure major illnesses. Will you feel sorry for my computer because it’s working so hard? Will the computer complain? No.You can make demands, give the computer its orders, and crack the whip. Will you (or should you) feel the least bit guilty? Not at all.
-
Computers move ideas, not paper. Not long ago, whenever you wanted to send a message to someone, you hired a messenger. The messenger mounted a horse and delivered your message personally. The message was recorded on paper or parchment or a clay tablet or whatever other physical medium was available at the time.
This whole process seems wasteful now, but that’s only because you and I are sitting comfortably in the electronic age. Messages are ideas, and physical objects like ink, paper, and horses have little or nothing to do with real ideas; they’re just temporary carriers of ideas (even though people used them for several centuries to carry ideas). Nevertheless, the ideas themselves are paperless, horseless, and messengerless.
The neat thing about computers is that they carry ideas efficiently. They carry nothing but the ideas, a couple of photons, and some electrical power. They do this with no muss, no fuss, and no extra physical baggage.
When you start dealing efficiently with ideas, something very nice happens: Suddenly, all overhead is gone. Instead of pushing paper and trees, you’re pushing numbers and concepts. Without the overhead, you can do things much faster and do things that are far more complex than ever.
What You Can Do with Java
It would be nice if all this complexity were free, but, unfortunately, it isn’t. Someone has to think hard and decide exactly what to ask the computer to do. After that thinking takes place, someone has to write a set of instructions for the computer to follow.
Given the current state of affairs, you can’t write these instructions in English or any other language that people speak. Science fiction is filled with stories about people who make simple requests of robots and get back disastrous, unexpected results. English and other such languages are unsuitable for communication with computers, for several reasons:
- An English sentence can be misinterpreted. “No parking. Violators will be towed away at the owner's expense.” So, the parking space's owner will pay to tow my car? That's not so bad!
- It’s difficult to weave a complicated command in English. “Join flange A to protuberance B, making sure to connect only the outermost lip of flange A to the larger end of the protuberance B while joining the middle and inner lips of flange A to grommet C.”
- English sentences have lots of extra baggage. “Sentences have unneeded words.”
- English can be difficult to interpret. “John Wiley & Sons, Inc. shall pay net earnings to the Author (‘Barry Burd’) or the Author's assigns upon submittal of Java For Dummies, 9th Edition (‘the Work’) minus prepaid and accrued expenses and deferred charges, either directly or indirectly, within the meaning of section 4942(j)(3) or 4965(k)(5) for calendar year 2024.”
To tell a computer what to do, you have to use a special language to write terse, unambiguous instructions. A special language of this kind is called a computer programming language. A set of instructions written in such a language is called a program. When looked at as a big blob, these instructions are called software or code. Here’s what code looks like when it’s written in Java:
void main() {
var checkAmount = 1257.63;
println("Pay to the order of Dr. Barry Burd $" + checkAmount);
}
You may argue that ChatGPT and other generative AI tools narrow the gap between informal English and carefully written code. That's true to some extent. But computer code isn't going away anytime soon. Generative AI may hallucinate. And, in some critical applications, hallucinations are unacceptable. Besides, GPT tools don't create themselves. At this very moment (whenever you're reading my book, that is), thousands of people around the world are writing code to make GPT tools faster and more versatile. Programming isn't a dying art. It's a growing endeavor.
Why You Should Use Java
It’s time to celebrate! You’ve just picked up a copy of Java For Dummies, 9th Edition, and you’re reading Chapter 1. At this rate, you’ll be an expert Java programmer* in no time at all, so rejoice in your eventual success by throwing a big party.
To prepare for the party, I’ll bake a cake. I’m lazy, so I’ll use a ready-to-bake cake mix. Let me see: Add water to the mix and then add butter and eggs — hey, wait! I just looked at the list of ingredients. What’s MSG? And what about propylene glycol? That’s used in antifreeze, isn’t it?
I’ll change plans and make the cake from scratch. Sure, it’s a little harder, but that way, I get exactly what I want.
Computer programs work the same way: You can use somebody else’s program or write your own. If you use somebody else’s program, you use whatever you get. When you write your own program, you can tailor the program especially for your needs.
Writing computer code is a big, worldwide industry. Companies do it, freelance professionals do it, hobbyists do it — all kinds of people do it. A typical big company has teams, departments, and divisions that write programs for the company. But you can write programs for yourself or for someone else, for a living or for fun. In a recent estimate, the number of lines of code written each day by programmers in the world exceeds the number of methane molecules on the planet Jupiter.** Take almost anything that can be done with a computer — with the right amount of time, you can write your own program to do it. (Of course, the “right amount of time” may be quite long, but that’s not the point. Many interesting and useful programs can be written in hours or even minutes.)
- * In professional circles, a developer's responsibilities are usually broader than those of a programmer. But, in this book, I use the terms programmer and developer almost interchangeably.
- ** I made up this fact all by myself.
Gaining Perspective: Where Java Fits In
Here’s a brief history:
-
1954–1957: FORTRAN is developed.
FORTRAN was the first modern computer programming language. For scientific programming, FORTRAN is a real racehorse. Year after year, FORTRAN is a leading language among computer programmers throughout the world.
-
1959: Grace Hopper at Remington Rand develops the COBOL programming language.
The letter B in COBOL stands for Business, and business is just what COBOL is all about. The language’s primary feature is the processing of one record after another, one customer after another, or one employee after another.
Within a few years after its initial development, COBOL became the most widely used language for business data processing.
(Fun fact: I once foolishly tried to write a COBOL program to create musical compositions. Talk about picking the wrong tool for the job! It was like brushing my teeth with a nail file.)
-
1960: John McCarthy writes a paper on his new LISP programming language.
LISP sets the stage for a style of programming called functional programming. For a few decades, functional programming waits in the background while other programming techniques take center stage.
-
1967: Scientists at the Norwegian Computing Center develop the Simula 67 language.
With Simula 67, object-oriented programming is born.
-
1972: Dennis Ritchie at AT&T Bell Labs develops the C programming language.
The “look and feel” that you see in this book’s examples comes from the C programming language. Code written in C uses curly braces,
ifstatements,forstatements, and other elements.In terms of power, you can use C to solve the same problems that you can solve by using FORTRAN or Java or any other modern programming language. The difference between one programming language and another isn't power — the difference is ease and appropriateness of use. That's where the Java language excels.
-
1986: Bjarne Stroustrup (also at AT&T Bell Labs) develops C++.
Unlike its C...
| Erscheint lt. Verlag | 19.12.2024 |
|---|---|
| Sprache | englisch |
| Themenwelt | Informatik ► Programmiersprachen / -werkzeuge ► Java |
| Schlagworte | beginning java • Java • java 2025 • java 2026 • java beginners • java book • java coding • java coding book • java developing • java dummy • Java programming • java programming book • java reference • learn code java • learn java • learn java coding |
| ISBN-10 | 1-394-28925-1 / 1394289251 |
| ISBN-13 | 978-1-394-28925-7 / 9781394289257 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belletristik und Sachbüchern. Der Fließtext wird dynamisch an die Display- und Schriftgröße angepasst. Auch für mobile Lesegeräte ist EPUB daher gut geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich