Introduction to File Processing

Only available on StudyMode
  • Download(s) : 42
  • Published : June 20, 2012
Open Document
Text Preview
INTRODCUTION TO FILE PROCESSING(CSC012-2011/2012)
COURSE NOTES CONTENT:
A STEP BY STEP APPROACH TO WRITING CODES IN JAVA SE ON NETBEANS IDE (Integrated Development Environment)

ACRONYMS AND SIMPLIFIED TIPS AT UNDERSTANDING THE BASIC FUNDAMENTALS IN JAVA

SYNTAX OF CODES AND BYTECODES

NOTIFICATIONS OF VARIABLES, IT’S USES AND PURPOSE

OPERATORS AND OPERAND
BASIC FUNDAMENTALS
program: A set of instructions to be carried out by a computer. program execution: The act of carrying out the instructions contained in a program. programming language: A systematic set of rules used to describe computations in a format that is editable by humans.

SOME MODERN LANGUAGES
procedural languages: programs are a series of commands Pascal (1970):designed for education
C (1972):low-level operating systems and device drivers functional programming: functions map inputs to outputs Lisp (1958) / Scheme (1975), ML (1973), Haskell (1990)
object-oriented languages: programs use interacting "objects" Smalltalk (1980): first major object-oriented language
C++ (1985):"object-oriented" improvements to C
successful in industry; used to build major OSes such as Windows Java (1995):designed for embedded systems, web apps/servers Runs on many platforms (Windows, Mac, Linux, cell phones...) The language taught in this textbook

WHY JAVA
Relatively simple
Object-oriented
Pre-written software
Platform independent (Mac, Windows…)
Widely used
#1 in popularity ie http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

First Java programs
Let us look at the classic Hello World! in Java with the comments /**,*/ /**
*
* @author Majesty
*/
public class HelloWorld {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Hello World!");
}
}
See HelloWorld.java

Another look at Hello World! in Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
This is without the comments.
COMPILING/RUNNING A PROGRAM
1.Write it.
code or source code: The set of instructions in a program. 2.Compile it.
compile: Translate a program from one language to another. byte code: The Java compiler converts your code into a format named byte code that runs on many computer types. 3.Run (execute) it.
output: The messages printed to the user by a program.

ANOTHER JAVA PROGRAM
public class HelloAgain {
public static void main(String[] args) {

System.out.println("Hello, world!");
System.out.println();
System.out.println("This program produces");
System.out.println("four lines of output");
}
}
Its output:
Hello, world!

This program produces
four lines of output
console: Text box into which the program's output is printed. Every executable Java program consists of a class,
that contains a method named main,
that contains the statements (commands) to be executed. NAMES AND IDENTIFIERS
You must give your program a name.
public class IrishPoetry {
Naming convention: capitalize each word (e.g. MyClassName) Your program's file must match exactly (IrishPoetry.java) includes capitalization (Java is "case-sensitive") identifier: A name given to an item in your program. must start with a letter or _ or $ subsequent characters can be any of those or a number

legal:_myName TheCure ANSWER_IS_42 $bling$
illegal:me+u 49ers side-swipe Ph.D's

KEYWORDS
keyword: An identifier that you cannot use because it already has a reserved meaning in Java. abstractdefaultif private this
booleandoimplements protected throw
Breakdouble import public throws
Byteelseinstanceof return...
tracking img