New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Chapter 1 Notes

by: Lindsey Notetaker

Chapter 1 Notes MIS 3370

Lindsey Notetaker

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

These notes cover the material in chapter 1, including the vocabulary, concepts, and diagrams.
Info Systems Development Tools: Java
Randolph Cooper
Class Notes
java, programming, data
25 ?




Popular in Info Systems Development Tools: Java

Popular in Management Information Systems

This 12 page Class Notes was uploaded by Lindsey Notetaker on Tuesday August 9, 2016. The Class Notes belongs to MIS 3370 at University of Houston taught by Randolph Cooper in Fall 2015. Since its upload, it has received 8 views. For similar materials see Info Systems Development Tools: Java in Management Information Systems at University of Houston.

Popular in Management Information Systems


Reviews for Chapter 1 Notes


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 08/09/16
Chapter 1 Java Notes Programming Technology  Computer Program—a set of instructions that you write to tell a computer what to do.  Hardware—computer equipment (monitor, keyboard)  Software—computer/system programs  Application Software—a program that performs a task for a user (calculating and producing paychecks, word processing, playing a game).  System Software—a program that manages the computer itself (Windows or Linux)  Logic—determines the exact order of instructions needed to produce desired results (whether it is an application or system program)  Machine Language (Machine Code)—the most basic set of instructions that a computer can execute. o All programs are ultimately converted to machine language. o Each type of processor (the internal hardware that handles computer instructions) has its own set of machine language instructions. o Programmers often use 1s and 0s to describe machine language to represent the on-and-off circuitry of computer systems.  Binary Numbering System—the systems that use only 1s and 0s.  Low-Level Programming Language—machine language that corresponds closely to a computer processor’s circuitry. o Low-level languages require you to use memory addresses for specific machines when you create commands. o Difficult to use and must be customized for ever type of machine on which a program runs.  High-Level Programming Language—allows you to use a vocabulary of reasonable terms, such as read, write, or add, instead of the sequences of 1s and 0s that perform these tasks. o Programming evolved to using high-level languages. o Allows you to assign single-word, intuitive names to areas of computer memory where you store data. o Over 2,000 high-level programming languages are available to developers o Java is a high-level programming language  Syntax—rules about how language elements are combined correctly to produce usable statements. o Each high-level language has its own syntax o All languages have a specific limited vocabulary and a specific set of rules for using that vocabulary.  Keywords—a language’s specific, limited vocabulary.  Program Statements—carry out the tasks they want the program to perform o Programmers write a series of program statements using a programming language o Also known as commands  Commands—orders to the computer (such as “output this word” or “add these two numbers”)  Compiler or Interpreter—translates language statements into machine language o After the program statements are written, high-level language programmers use a computer program called a compiler/interpreter to translate o **A compiler translates an entire program before carrying out any statements or executing them. o **An interpreter translates one program statement at a tome, executing a statement as soon as it is translated.  Whether you use a compiler or interpreter often depends on the programming language you use.  Examples: o C++ is a compiled language o Visual Basic is an interpreted language o Java uses both, a compiler to translate your programming statements, and an interpreter to read the compiled code line by line when the program executes o Compilers and interpreters issue one or more error message each time they encounter an invalid program statement (a syntax error) o Syntax Error—misuse of the language  Examples: misspelling a keyword or omitting a word that a statement requires  When a syntax error is detected, the programmer can correct the error and attempt another translation.  Debugging—freeing a program of all flaws or errors known as bugs. o Repairing all syntax errors is the first step of debugging a program.  At Run Time—when the program executes  Logic Error (Semantic Errors)—a bug that allows a program to run, but that causes it to operate incorrectly. o You might write a program with correct syntax that still contains logic errors o Examples: multiplying two values when you meant to divide them, or producing output prior to obtaining the appropriate output.  Correct Logic—require that all the right commands be issued in the appropriate order.  **When you develop a program of any significant size, you should plan its logic before you write any program statements**  **Correcting logic errors is much more difficult than correcting syntax errors that the language translator discovers**  **Just because a program produces correct output, does not mea it is free from logic errors**  If you misspell a programming language word, you create a syntax error, but if you use a correct word in the wrong context, you commit a semantic error. Comparing Procedural and Object-Oriented Programming Concepts Two popular approaches to writing computer programs are procedural programming and object-oriented programming. Procedural Programming  Procedural Programming—a style of programming in which operations are executed one after another in sequence. o You create names for computer memory locations that can hold values (numbers and text) in electronic form  Variables—the named computer memory locations; they hold values that might vary. o Memory locations may contain different values at different times (rateOfPay may contain a different value foe every employee of the company)  Procedures—logical units where the individual operations in a computer program are often grouped. o Example: a series of four or five comparisons and calculations that together determine a person’s federal withholding tax value might be grouped as a procedure named calculateFederalWithholding.  Calls a Procedure—when a program calls a procedure, the current logic is temporarily abandoned so that the procedure’s commands can execute.  A single procedural program often contains hundreds of variables and procedure calls.  Procedures—also called modules, methods, functions, and subroutines. o Java programmers most frequently use the term method. Object-Oriented Programming  Object-Oriented Programming—an extension of procedural programming in which you take a slightly different approach to writing computer programs. o OO = object-oriented o OOP = object-oriented programming Writing object-oriented programs involves: 1. Creating classes, which are blueprints for objects 2. Creating objects, which are specific instances of those classes 3. Creating applications that manipulate or use those objects Object-oriented programming was originally used more frequently for two major types of applications: 1. Computer Simulations—attempt to mimic real-world activities so that their processes can be improved or so that users can better understand how the real-world processes operate 2. Graphical User Interfaces (GUIs)—which allow users to interact with a program in a graphical environment.  **Example: Developing a program that simulates traffic patterns to help prevent traffic tie-ups: programmers would create classes for objects such as cars and pedestrians that contain their own data and rules for behavior** o Each car has a speed and a method for changing that speed o The specific instances of that car could be set in motion to create a simulation of a real city at rush hour  **It is easy to think of the components a user manipulates on a computer screen, such as buttons and scroll bars, as similar to real-world objects. o Each GUI object contains data—a button on a screen has a specific size and color o Each object also contains behaviors—each button can be clicked and reacts in a specific way when clicked  Some consider object-oriented programming to be synonymous with GUI programming, but object-oriented programming means more.  ***Although many GUI programs are object-oriented, not all object- oriented programs use GUI objects***  Understanding OOP requires grasping three basic concepts: o Encapsulation as it applies to classes as objects o Inheritance o Polymorphism Understanding Classes, Objects, and Encapsulation  Class—a term that describes a group or collection of objects with common properties. o A class definition exists before any objects are created from it o Example: in the same way that a blueprint exists before any houses are built from it  Class Definition—describes what attributes its objects will have and what those objects will be able to do.  Attributes—the characteristics that define an object; the properties of an object.  **When you learn a programming language such as Java, you learn to work with two types of classes: o 1. Those that have already been developed by the language’s creators o 2. Your own new, customized classes  Object—a specific, concrete instance of a class.  Instantiation—creating an instance  You can create objects from classes that you write and from classes written by other programmers, including Java’s creators.  **The values contained in an object’s properties often differentiate instances of the same class from one another** o Example: The class Automobile describes what Automobile objects are like.  Some properties of the Automobile class are make, model, year, and color  Each Automobile object possesses the same attributes, but not necessarily the same values for those attributes.  One Automobile might be a 2010 white Ford Taurus and another might be a 2015 red Chevrolet Camaro. o Example: Your dog has the properties of all Dogs, including a breed, name, age, and whether its shots are current  The values of these properties will vary  State—an object’s state is the values of the properties of an object. o **You can think of objects as roughly equivalent to nouns, and of their attributes as similar to adjectives that describe the nouns**  When you understand an object’s class, you understand the characteristics of the object.  Figure 1-2 -- Example of class and objects created from it.  ***Besides defining properties, classes define methods their objects use**  Method—a self-contained block of program code that carries out some action, similar to a procedure in a procedural program. o Example: An Automobile might have methods for moving forward, moving backward, and determining the status of its gas tank o Example: A Dog might have methods for walking, eating, and determining its name. o Example: A program’s GUI components might have methods for maximizing and minimizing them as well as determining their size. o Methods are similar to verbs  Objects similar to nouns  Encapsulation—refers to two closely related object-oriented notions: 1. Encapsulation is the enclosure (attachment/addition) of data and methods within an object. Encapsulation allows you to treat all of an object’s methods and data as a single entity (object/thing). Just as an actual dog contains all of its attributes and abilities, so would a program’s Dog object. 2. Encapsulation also refers to the concealment of an object’s data and methods from outside sources. Concealing data is sometimes called information hiding, and concealing how methods work is implementation hiding. Encapsulation lets you hide specific object attributes and methods from outside sources and provides the security that keeps data and methods safe from inadvertent (unplanned) changes.  In object-oriented classes, attributes and methods are encapsulated into objects.  **In well-constructed classes used in object-oriented programs, programs that use classes only need to work with interfaces** Understanding Inheritance and Polymorphism  Inheritance—the ability to create classes that share attributes and methods of existing classes, but with more specific features. o Example: Automobile is a class, and all Automobile objects share many traits and features  Convertible is a class that inherits from the Automobile class  A Convertible is a type of Automobile that has and can do everything a “plain” Automobile does—but with an added ability to lower its top.  Convertible is not an object, it is a class. A specific Convertible is an object—for example, my1967BlueMustangConvertible.  (Automobile inherits from the Vehicle class) o Example: The first time you encounter a convertible, you already understand how the ignition, brakes, door locks, and other systems work because you realize that a convertible is a type of automobile, so you need to be concerned only with the attributes and methods that are “new” with a convertible.  **You can build new classes based on existing class and concentrate on the specialized features you are adding**  Polymorphism—describes the feature of languages that allows the same word or symbol to be interpreted correctly in different situations based on their context. o Literally means “many forms” o Example: although the classes Automobile, Sailboat, and Airplane all inherit from Vehicle, turn and stop methods work differently for instances of those classes.  When you see a plus sign between two numbers, you understand they are being added. When you see it carved in a tree between two names, you understand the two names are linked romantically. o Because the symbol has diverse meanings based on context, it is polymorphic. Features of the Java Programming Language  Java—developed by Sun Microsystems as an object-oriented language for general-purpose business applications and for interactive, World Wide Web-based Internet applications.  Advantages of Java: 1. Its security features 2. The fact that it is architecturally neutral—unlike other languages, you can use Java to write a program that runs on any operating system or device.  Java can be run on a variety of computers and devices because it does not execute on a computer directly.  Java Virtual Machine (JVM)—Java runs on a hypothetical computer known as the JVM. o Hypothetical meaning it is not a physical entity created from hardware, but is composed only of software.  Source Code—programming statements written in a high-level programming language. o When you write a Java program, you first construct the source code using a text editor  Development Environment—a set of tools that help you write programs by providing such features as displaying a language’s keywords in color. o The statements are saved in a file; then, the Java compiler converts the source code into a binary program of bytecode.  Bytecode—consists of programming statements that have been compiled into binary format.  Java Interpreter—a program that checks the bytecode and communicate with the operating system, executing the bytecode instructions line by line within the Java Virtual Machine.  **Java is isolated from the operating system and also insulated from the particular hardware on which it is run** o Because of this insulation, the JVM provides security against intruders accessing your computer’s hardware through the operating system. o Java is more secure than other languages.  **The JVM gives less work for programmers o When using other programming languages, software vendors usually have to produce multiple versions of the same product (Windows version, Mac version, etc) so all users can run the program**  “Write Once, Run Anywhere” (WORA)—the slogan developed by Sun Microsystems to describe the ability of one Java program version to work correctly on multiple platforms.  Java is simpler to use than many other object-oriented languages. o Java is modeled after C++, but is simpler to use because of the elimination of the most difficult-to-understand features in C++ Java Program Types You can write two kinds of programs using Java: 1. Applets—programs that are embedded in a Web page. 2. Java Applications—stand-alone programs. Further subdivided: o Console applications—support character or text output to a computer screen (easier applications) o Windowed applications—create a GUI with elements such as menus, toolbars, and dialog boxes. Understanding the Statement that Produces Output  Literal String—a series of characters that will appear in output exactly as entered. o Any literal string in java is written between double quotation marks. o A literal string cannot be broken and placed on multiple lines. System.out.println(“First Java application”); o “System” is the name of an object o “out” is a property of the System class o “println()” is a method. Method names are always followed by parentheses o “First Java application” is a literal string that is the argument to the println() method. o Dots separate classes, objects, and methods. o Every Java statement ends with a semicolon.  **The string “First Java application” appears within parentheses because the string is an argument to a method, and arguments to methods always appear within parentheses**  Arguments—pieces of information that are sent into a method.  Passing Arguments—the act of sending arguments to a method. o Within the statement “System.out.println(“First Java application);, the method to which you are passing “First Java application” to is named println().  **When you call a method, you always use parentheses following the method name**  Dots are used to separate the names of the components in the statement Understanding the First Class Everything that you use within a Java program must be part of a class.  Identifier—defining a class using any name (identifier) you need. o A Java identifier must:  Contain only letters, digits, underscores, or dollar signs.  Begin with a letter of the English alphabet, an underscore, or a dollar sign. Cannot begin with a digit  Cannot be a reserved keyword, such as public or class  Cannot be one of the following values: true, false, or null.  Pascal Casing (Upper Camel Casing)—the style that joins words in which each word begins with an uppercase letter  “public class First”: o Is considered the class header o Contains the keyword class, which identifies First as a class.  Access Specifier—defines the circumstances under which a class can be accessed and the other classes that have the right to use a class. o Public access is the most liberal type of access.  After the class header, you enclose the contents of a class within curly braces ( { and } ) o Any data items and methods between the curly braces make up the class body.  Class Body—can be composed of any number of data items and methods —between curly braces of a class header  Figure 1-6 – Class that contains main() method and a println() method within it. The main() method does not contain any other methods, but it calls the println() method. Indent Style  K & R Style—the indent style in which opening braces do not stand alone on separate lines. o Named for Kernighan and Ritchie, who wrote the first book on C programming language  Allman Style—indent style in which curly braces are aligned and each occupies its own line o Named for Eric Allman, a programmer who popularized the style.  **Must develop a consistent style of which your organization approves** Understanding the main() Method public static void main(String[] args) o Is a method header o “public” is an access specifier o “static” -- ??? o “void” is the method’s return type  Indicates that the main() method does not return any value when it is called This does not mean that main() does not produce any output, it does. It means that the main() method does not send any value back to any other method that might use it. o “main()” is the name of the method.  Begins with a lowercase letter  Not all classes have a main() method  However, all Java applications must include a class containing a public method named main(), and most Java applications have additional classes and methods.  When you execute a Java application, the JVM always executes the main() method first.  “String[] args” represents the type of argument that can be passed to the main method, (just as the string “First Java application” is an argument passed to the println() method). “String” is a Java class that can be used to hold character strings “args” an identifier that is used to hold any String objects that might be sent to the main() method. o The main() method does not actually use the args identifier; nevertheless, you must place an identifier within the main() method parentheses.  Does not need to be named args, can be any legal Java identifier, but the name args is traditional. Saving a Java Class  When you write a Java class, you must save it using a writable storage medium such as a disk, DVD, or USB device.  In Java, if a class is public (that is, you use the public access specifier before the class name), you must save the class in a file with exactly the same name and a .java extension. o If the extension is not .java, the Java compiler does not recognize the file as containing a Java class. Correcting Syntax Errors  Compile-Time Errors—an error in which the compiler detects a violation of language syntax rules and is unable to translate the source code to machine code.  **Fixing one error might eliminate multiple error messages**  **After you write and save an application, you can compile the source code to create bytecode** Correcting Logic Errors  Besides syntax errors, a second kind of error occurs when the syntax of the program is correct and the program compiles but produces incorrect results when you execute it. o Known as a logic error  The compiler does not find spelling errors within a literal string.  Run-Time Errors—an error not detected until the program asks the computer to do something wrong, or even illegal, while executing. Adding Comments to a Java Class Documenting your program code helps you remember why you wrote lines of code the way you did, especially in larger applications as it becomes increasingly difficult to remember why you included steps or how you intended to use particular variables.  Program Comments—non-executing statements that you add to a program for the purpose of documentation. o Designed for people reading the source code and not for the computer executing the program.  At the very least, your Java class files should include comments indicating the author, the date, and the class name or function.  The best practice dictates that you also include a brief comment to describe the purpose of each method you create within a class.  Comment Out—when you “comment out” a statement, you turn it into a comment so the compiler does not translate it, and the JVM does not execute its command. o This can help you pinpoint the location of errant (misbehaving) statements in malfunctioning programs.  Three types of comments in Java, two of which we will use: o Line Comments—start with two forward slashes ( // ) and continue to the end of the current line.  Can appear on a line by itself or at the end (and to the right) of a line following an executable code.  Do not require an ending symbol o Block Comments—start with a forward slash and an asterisk ( /* ) and end with an asterisk and a forward slash ( */ ).  Can appear on a line by itself, on a line before executable code, or on a line after executable code.  Can extend across as many lines as needed  **When a program is used in a business setting, the program frequently is modified over time because of changing business needs. If a programmer changes code but does not change the comments that go with it, it’s very possible that people who read the program in the future will be confused or misled. When you modify a program it’s important to change any relevant comments** Creating a Java Application that Produces GUI Output Besides allowing you to use the System class to produce command window output, Java provides built-in classes that produce GUI output.  Java contains a class named JOptionPane that allows you to produce dialog boxes.  Dialog Box—a GUI object resembling a window in which you can place messages you want to display.  Import Statement—when you want to access a built-in Java class that is contained in a group of classes called a package.  To use the JOptionPane class, you must import the package named “javax.swing.JOptionPane”  Any import statement you use must be placed outside of any class you write in a file. o You do not need to use an import statement when you use the System class (as with the System.out.println() method) because the System class is contained in the package java.lang, which is automatically imported in every Java program. You could include the statement “import java.lang;” at the top of any file in which you use the System class, but you are not required to do so.  JOptionPane.showMessageDialog(null, “First Java dialog”); o This statement uses the showMessageDialog() method that is part of the JOptionPane class. o Like the println() method that is used for console output, the showMessageDialog() method starts with a lowercase letter and is followed by a set of parentheses.  **However, whereas the println() method requires only one argument between its parentheses to produce an output string, the showMessageDialog() method requires two arguments**  Arguments are separated by commas o When the first argument to showMessageDialog() is “null” it means the output message box should be placed in the center of the screen. o The second argument, after the comma, is the literal string that is displayed. Finding Help Java API—the Java application programming interface; also called the Java class library. o Contains information about how to use every prewritten Java class, including a list of all methods you can use within classes. Java Development Kit (JDK)—a software development kit that includes tools used by programmers. SDK—software development kit Don’t Do It  Don’t forget that in Java, a public file’s name must match the name of the class it contains.  Don’t confuse the terms parentheses, braces, brackets, curly braces, and square brackets.  Don’t forget to end a block comment. Every /* must have a corresponding */, even if it is several lines later. It is harder to make a mistake with line comments (those that start with //), but remember that nothing on the line after the // will execute.  Don’t forget that Java is case sensitive  Don’t forget to end every statement with a semicolon, but not to end class or method headers with a semicolon  Don’t forget to recompile a program to which you have made changes.  Don’t panic when you see a lot of compiler error messages. Often, fixing one will fix several.  Don’t think your program is perfect when all compiler errors are eliminated. Only by running the program multiple times and carefully examining the output can you be assured that your program is logically correct.


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.