Wednesday, April 14, 2010

Topicz that have been discuss in JAVA Programming1

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 Stucture

Control 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.


No comments:

Post a Comment