Introduction to Java Session 1
Java - History Developed by a team 18 members headed by James Gosling JDK 1.0 is the first working edition of java released by sun Microsystems in 1991. JDK 1.2 to JDK 1.7 are commonly known as Java2, JDK 1.5 or jdk5 is the most commonly used java version.
Features Simple and Strictly Object Oriented Multi-Threaded Distributed Secure Self-Documented Robust Platform Independent or Architecture Neutral
Simple Simple, because of having the most accepted languages C & C++ being inspirers, and because of having a very few key words 50 in number. Strictly Object Oriented Strictly object oriented because, that unless and until OOPs are implemented, not a single java code can be executed, unlike other languages like C++ where OOPs concept is a optional feature.
Multi-Threaded Java supports multi – threaded programming. Every java program itself is a thread under JVM. Distributed Distributed programming is supported by java through.. RMI TCP/IP Sockets  EJB ..etc.,
Secure Java doesn’t provide pointers or pointer like concepts and hence it can not produce potentially damaging code. No Memory access or file system access is available to a java program unless it is authenticated. Robust Supports Object Oriented Exception Handling Supports advanced techniques like Threads, Distributed ness ..etc,.
Self-Documented Java provided a  unique provision of special comments, on using which the program can document his/her code while constructing the same. This can later be extracted to some html documents. This is based on some coding standards, and special tokens of comments.
Coding Standard - 1 Names of variables and methods shall start with and continue in lowercase, but from the second token onwards, initial capitals is to be followed Example Variable Names: height heightInMeters boxHeightInMeters Example Method Names: show() toString() itemStateChanged()
Coding Standard - 2 Names of user defined data types like classes, interfaces, enumeration shall start and constinue in initial capitals. Examples: Box BoxWithLid ArrayIndexOutOfBoundsException
Coding Standard - 3 Names of constants are all capitals, and each token is separated with an (_) underscore. Examples: PIE E AVEGADROS_CONSTANT LIGHT_VELOCITY
Coding Standard - 4 Names of Java packages are all lower in case and mostly are not more than a token. Example Variable Names: java util lang io
Platform Independent Java code is basically of the notion write once, execute it anywhere, anytime. Platform independency means that the code once compiled can be executed on any OS and on any hardware configuration.
Java Virtual Machine JIT Reflection Classes GC
Compilation of languages like C & C++ Source Code Linux Windows MAC COMPILES ON Linux Executable Code Windows Executable Code MAC Executable Code COMPILES INTO
Java Compilation Source Code COMPILES ON JVM COMPILES INTO JVM understandable Intermediate Byte Code – a class file Class File JVM ------- Linux JVM ----------- Windows JVM ------ MAC Executes ON

sravan java Session1

  • 1.
  • 2.
    Java - HistoryDeveloped by a team 18 members headed by James Gosling JDK 1.0 is the first working edition of java released by sun Microsystems in 1991. JDK 1.2 to JDK 1.7 are commonly known as Java2, JDK 1.5 or jdk5 is the most commonly used java version.
  • 3.
    Features Simple andStrictly Object Oriented Multi-Threaded Distributed Secure Self-Documented Robust Platform Independent or Architecture Neutral
  • 4.
    Simple Simple, becauseof having the most accepted languages C & C++ being inspirers, and because of having a very few key words 50 in number. Strictly Object Oriented Strictly object oriented because, that unless and until OOPs are implemented, not a single java code can be executed, unlike other languages like C++ where OOPs concept is a optional feature.
  • 5.
    Multi-Threaded Java supportsmulti – threaded programming. Every java program itself is a thread under JVM. Distributed Distributed programming is supported by java through.. RMI TCP/IP Sockets EJB ..etc.,
  • 6.
    Secure Java doesn’tprovide pointers or pointer like concepts and hence it can not produce potentially damaging code. No Memory access or file system access is available to a java program unless it is authenticated. Robust Supports Object Oriented Exception Handling Supports advanced techniques like Threads, Distributed ness ..etc,.
  • 7.
    Self-Documented Java provideda unique provision of special comments, on using which the program can document his/her code while constructing the same. This can later be extracted to some html documents. This is based on some coding standards, and special tokens of comments.
  • 8.
    Coding Standard -1 Names of variables and methods shall start with and continue in lowercase, but from the second token onwards, initial capitals is to be followed Example Variable Names: height heightInMeters boxHeightInMeters Example Method Names: show() toString() itemStateChanged()
  • 9.
    Coding Standard -2 Names of user defined data types like classes, interfaces, enumeration shall start and constinue in initial capitals. Examples: Box BoxWithLid ArrayIndexOutOfBoundsException
  • 10.
    Coding Standard -3 Names of constants are all capitals, and each token is separated with an (_) underscore. Examples: PIE E AVEGADROS_CONSTANT LIGHT_VELOCITY
  • 11.
    Coding Standard -4 Names of Java packages are all lower in case and mostly are not more than a token. Example Variable Names: java util lang io
  • 12.
    Platform Independent Javacode is basically of the notion write once, execute it anywhere, anytime. Platform independency means that the code once compiled can be executed on any OS and on any hardware configuration.
  • 13.
    Java Virtual MachineJIT Reflection Classes GC
  • 14.
    Compilation of languageslike C & C++ Source Code Linux Windows MAC COMPILES ON Linux Executable Code Windows Executable Code MAC Executable Code COMPILES INTO
  • 15.
    Java Compilation SourceCode COMPILES ON JVM COMPILES INTO JVM understandable Intermediate Byte Code – a class file Class File JVM ------- Linux JVM ----------- Windows JVM ------ MAC Executes ON