Friday, 1 August 2008

Java For Dummies By Barry Burd

Just now i completed reading Java For Dummies By Barry Burd

I think this book is really for dummies and donot buy this book for getting more information other than creating sample java programs.

Few points i want to share from the book

1) Here’s a brief history of modern computer programming:

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: COBOL is created.
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. Even today, COBOL represents a large part of the computer programming industry.

1972: Dennis Ritchie at AT&T Bell Labs develops the C programming language.
Code written in C uses curly braces, if statements,for statements, and so on.In terms of power, you can use C to solve the same problems that you can solve by using FORTRAN, Java, or any other modern programming language. (You can write a scientific calculator program in COBOL, but doing that sort of thing would feel really strange.) 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 (again at AT&T Bell Labs) develops C++.
Unlike its C language ancestor, the language C++ supports object-oriented programming. This represents a huge step forward.

May 23, 1995: Sun Microsystems releases its first official version of the Java programming language.
Java improves upon the concepts in C++. Java’s “Write Once, Run Anywhere” philosophy makes the language ideal for distributing code across the Internet.In addition, Java is a great general-purpose programming language. With Java, you can write windowed applications, build and explore databases, control handheld devices, and more. Within five short years, the Java programming language had 2.5 million developers worldwide.

November 2000: The College Board announces that, starting in the year 2003, the Computer Science Advanced Placement exams will be based on Java.Wanna know what that snot-nosed kid living down the street is learning
in high school? You guessed it — Java.

2002: Microsoft introduces a new language named C#.Many of the C# language features come directly from features in Java.

March 2003: SkillMarket reports that the demand for Java programmers tops the demand for C++ programmers by 42 percent.And there’s more! The demand for Java programmers beats the combined demand for C++ and C# programmers by 10 percent. Java programmers are more employable than VB (Visual Basic) programmers by a whopping 111 percent.

2005: Over 90 percent of the Fortune 500 depend on Java technology for some aspect of their business transactions.

2) These days, applets are passé. Real Java programmers roll their eyes when they hear the word applet. Three reasons for this are:

a) Since the mid-1990s, better technologies have emerged for putting eyecatching content onto Web pages.

b) Microsoft, the maker of the world’s most powerful Web browser, refused to give its browser the most up-to-date Java tools.

c) For Java programmers, the real money isn’t in creating glittery Web pages. The real money is in business applications with Java EE.

3) Keywords: A keyword is a word that has its own special meaning in the Java programming language, and that meaning doesn’t change from one program to another. Examples of keywords in Java include if, else, and do.

4) Java has two different types that have digits beyond the decimal point: type double and type float. So what’s the difference? When you declare a variable to be of type double,you’re telling the computer to keep track of 64 bits when it stores the variable’s values. When you declare a variable to be of type float, the
computer keeps track of only 32 bits.

5) Good programming

When it comes to good computer programming practice, one word stands out above all others — simplicity. When you’re writing complicated code, the last thing you want is to deal with somebody else’s misnamed variables; convoluted solutions to problems; or clever, last-minute kludges. You want a clean interface that makes you solve your own problems and no one else’s.

6) Example of usage of Scanner class.Below program tries to replicate employee payroll system and below one is a dummy implementation.


class DoPayroll {
public static void main(String args[]) throws IOException {
Scanner diskScanner =new Scanner(new File("c:\\xml\\EmployeeInfo.txt"));
for (int empNum = 1; empNum <= 3; empNum++) {
payOneEmployee(diskScanner);
}
}
static void payOneEmployee(Scanner aScanner) {

Employee anEmployee = new Employee();
anEmployee.setName(aScanner.nextLine());
anEmployee.setJobTitle(aScanner.nextLine());
anEmployee.cutCheck(aScanner.nextDouble());
aScanner.nextLine();
}
}

import static java.lang.System.out;

class Employee {

private String name;
private String jobTitle;

public void setName(String nameIn) {
name = nameIn;
}

public String getName() {
return name;
}

public void setJobTitle(String jobTitleIn) {
jobTitle = jobTitleIn;
}

public String getJobTitle() {
return jobTitle;
}

public void cutCheck(double amountPaid) {
out.printf("Pay to the order of %s ", name);
out.printf("(%s) ***$", jobTitle);
out.printf("%,.2f\n", amountPaid);
}
}



EmployeeInfo.txt

Barry Burd
CEO
5000.00
Harry Ritter
Captain
7000.00
Your Name Here
Honorary Exec Of the Day
10000.00

Prints

Pay to the order of Barry Burd (CEO) ***$5,000.00
Pay to the order of Harry Ritter (Captain) ***$7,000.00
Pay to the order of Your Name Here (Honorary Exec Of the Day) ***$10,000.00

7) Subclasses don’t inherit constructors.Constructors are never static.

Hope you enjoy reading this book.

About The Author

Dr. Barry Burd received an M.S. degree in Computer Science at Rutgers University and a Ph.D. in Mathematics at the University of Illinois. As a teaching assistant in Champaign-Urbana, Illinois, he was elected five times to the university-wide List of Teachers Ranked as Excellent by their Students.Since 1980, Dr. Burd has been a professor in the Department of Mathematics and Computer Science at Drew University in Madison, New Jersey. When he’s not lecturing at Drew University, Dr. Burd leads training courses for professional programmers in business and industry. He has lectured at conferences in the United States, Europe, Australia, and Asia. He is the author of several articles and books, including Eclipse For Dummies and Beginning
Programming with Java For Dummies, both from Wiley Publishing, Inc.

Dr. Burd lives in Madison, New Jersey, with his wife and two children. In his spare time, he enjoys being a workaholic.

5 comments:

Anonymous said...

I thought this book was great. It was fun to read and it made Java more understandable.

JP said...

Hi,

To some extent i will agree with you but as i said i thought this is for freshers only.

Thanks
Prashant

Anonymous said...

Well.... it IS a book for "Dummies"... it's not meant to be an advanced study. It's just the kind of book I needed to help me lock in the basic concepts... took me from "fresher" to just plain "fresh"

Anonymous said...

Well Prashant, I'm sure you have written a betten one. Please point me to it so that I may benefit from your superior teaching format.

Anonymous said...

Just what I was looking for. Thanks for the post.

Having been in the IT consulting biz since 1990 I've managed to avoid java until now.

I've been working in a procedural language environment for many years and the new task at hand is to become a java whiz before the next deliverable is due.

Whoops time for some homework.

So, this dummy needs to understand extremely basic concepts of java before trying to get that production-quality-level code out the door.

Yah and I wish myself luck on this as well :-)