java tips - Chapter 1 Introduction to Java Brief History of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 1 Introduction to Java Brief History of the Java Language Java began as a research project inside Sun Microsystems and developed by James gosling since 19 First released was in 1995 (java 1.0) which interested a bout what is known "web app " After no much time many of browsers support j In spite of success of java , problems began be noticed with elementary versions because of (1) a lot of (Bugs) that j continue, and (2) java has limited capabilities (250 classes) (3) deep slow in implementat In 1998 java was developed drastically through (1) The language syntax which derives much of its from C and C++ has a simpler object derives much of its from C and C++ but has a simpler object , (2) fu object-oriented,(3) Dynamic Memory Management (Garbage Collection), (4 ) "applications that are independent of hardware and operating systems?" It means you can compile a Java program on any system and run the resulting bin executable file on the same or any other syst How does java work At the beginning we write a source code file(.java) containing instructions of java , then passes it to the compiler wh ensures the file is free of error and build a new bytecode file (.class) which is independent on any platform will implem un Java structure Text-printing program 1 // Welcome1.java 2 // Text-printing program . 3 4 public class Welcome1 5 } 6 // main method begins execution of Java application 7 public static void main( String args ( 8 } 9 System.out.println( "Welcome to Java Programming ;( "! 10 11 // { end method main 12 13 // { end class Welcome1 Welcome to Java Programming ! Text-printing program illustration // indicating that the remainder of the line is a comment : // single line comment */ multiple Line coment /* class declaration Every program in Java consists of at least one class declaration that is defined by the programmer These are known as programmer-defined classes or user- defined classes The class keyword introduces a class declaration in Java and is immediately followed by the class name ( Welcome1 ). Keywords (sometimes called reserved words ) are reserved for use by Java By convention, all class names in Java begin with a capital letter and capitalize the first letter of each word they include (e.g., SampleClassName ). A Java class name is an identifier a series of characters consisting of letters, digits, underscores ( _ ) and dollar signs ( $ ) that does not begin with a digit and does not contain spaces Some valid identifiers are Welcome1, $value, _value, m_inputField1 and button7 . The name 7button is not a valid identifier because it begins with a digit, and the name...
View Full Document

Page1 / 45

java tips - Chapter 1 Introduction to Java Brief History of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online