Brief History of Java1
[] is a programming language originally developed by James Gosling at Sun MicrosystemsOracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiledbytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is general-purpose, concurrent, class-based, and object-oriented, and is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere". Java is considered by many as one of the most influential programming languages of the 20th century, and is widely used from application software to web applications.
Java Programming Structures
[]Control StuctureControl structures are a dynamic part of Java and come in several types: sequences, subprograms, selection statements, and loops.
[]Selection Structure
Also known as branch, conditional or decision structures, selections allow the program to execute different operations depending on events or conditions. This entails the use of the switch-case statement and the classic If-Then-Else statement.
With its roots in classic mathematics, the if-then-else is used in Java to quantify simple decisions under certain conditions. If something occurs, do this; else, do something different. The simplest form the selection statement can take is just the if-then statement:
if (testVar){
//Commands to execute
}
[]Sequential Structure
A sequence in Java is basically a list of commands that computer executes in order from beginning to end. Most small daily activities are sequential, such as cooking a meal or brushing teeth. A computer, like a human, finds sequential operations to be the simplest and as such the sequence is the default structure for Java programs
[]Repetition Structure
The Repetition Structure simply means to repeat or to loop certain pieces of code. Every loop requires an evaluation or else it will result in an endless loop; at some point the condition must test false in order to exit the loop.
[] Discussions[]method
A java method is a series of statements that perform some repeated task. Instead of writing 10 lines of code we can put those ten lines in a method and just call it in one line. It is like a shortcut.
[]packages
A Java package is a mechanism for organizing Java classes into namespaces similar to the modules of Modula. Java packages can be stored in compressed files called JAR files, allowing classes to download faster as a group rather than one at a time. Programmers also typically use packages to organize classes belonging to the same category or providing similar functionality.
[]classes
The Java Class Library is a set of dynamically loadable libraries that Java applications can call at runtime. Because the Java Platform is not dependent on any specific operating system, applications cannot rely on any of the existing libraries. Instead, the Java Platform provides a comprehensive set of standard class libraries, containing much of the same reusable functions commonly found in modern
[]Event Handling
event handler is an asynchronous callback subroutine that handles inputs received in a program. Each event is a piece of application-level information from the underlying framework, typically the GUI toolkit. GUI events include key presses, mouse movement, action selections, and timers expiring. On a lower level, events can represent availability of new data for reading a file or network stream. Event handlers are a central concept in event-driven programming.
[]Buffered ReaderBufferedReader wraps another Reader and improves performance.
BufferedReader provides a readLine method to read a line of text.
[]JOptionPane allow you to easily create dialog boxes for input and output. The Java API documentation has many more JOptionPane options, but these are sufficient for many uses. In the code below userInput and text are Strings.
[]Java AppletJava applet is an applet delivered to the users in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine (JVM), or in Sun's AppletViewer, a stand-alone tool for testing applets.
[]Formatting outputUsing Math.round method-Rounds a value to the nearest integer or specified number of decimal places.
[]Scanner classThe Scanner class is a class in java.util, which allows the user to read values of various types. There are far more methods in class Scanner than you will need in this course. We only cover a small useful subset, ones that allow us to read in numeric values from either the keyboard or file without having to convert them from strings and determine if there are more values to be read.
[]File I/Oinput/output, or I/O, refers to the communication between an information processing system (such as a computer), and the outside world possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it. The term can also be used as part of an action; to "perform I/O" is to perform an input or output operation.
[]ArrayAn array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You've seen an example of arrays already, in the main method of the "Hello World!" application.
No comments:
Post a Comment