Java Class - 1
Initial Setup Instructions
Resources
-
Head First Java: One of the best Java book for beginners.
-
Core Java Volume 1: Covers both basics and advanced topics in Java, Highly recommened for those who are already familiar with Java.
-
The Complete Java Reference: Another great book covering basics of Java in crisp and concise manner.
-
Oracle Docs: Best resource for learning Java, all you have to learn is how to search the docs :P. Recommend for advanced users.
-
Java TPoint: Great online resource for learning Java concepts.
-
Bucky Roberts Video Series: Great youtube playlist to learn java in a fun manner.
Java Basics and Useful Links
-
Java is an object oriented, class-based, concurrent, secured programming language.
-
Initiators: James Gosling, Mike Sheridan, and Patrick Naughton
- Features of java:
- Write once run anywhere
- Multithreated
- Security
- Built in graphics
- Object Oriented language
- Support Multimedia
- Open product
- Platform independent
- Command to set temporary path in cmd
- set path=C:\Program Files\Java<jdk_folder_name>\bin
- Compilation:
- Compile time
- javac fileName.java
- Class -> Compiler -> Bytecode
- Runtime
- java fileName
- classfile -> classloader -> bytecode verifier -> interpreter -> runtime -> hardware
- Compile time
- JDK
- Compiler(javac), tools(javap, java) + JRE
- JRE
- JVM + Euntime Environment
- Provide set of software tools which are used for developing Java applications.
- It is used to provide the runtime environment.
- JRE implements JVM.
- Since JRE is implementation of jvm therefore is also released by different other companies (openjdk, oraclejdk)
- JVM
- Can run anything compiled to bytecode. It is a virtual machine.
- JVM is system dependent.
-
Functions of JVM Loads code Verifies code Executes code Provides runtime environment
therefore used to convert and run bytecode line by line. bytecode -> machine code -> run that line
- How JVM Works
- JDK vs JRE vs JVM
- JIT
- line by line, hence –> performance problem – (solution needed) –> jit
- Hepls java interpreter to run and execute code faster
- Refer this link
- Two observations firstly of repeated code segments, secondly wrongly written code.
- Classes and Objects
- Refer the ppt for all the theory and examples
- this reference in Java
- instance vs static methods in java
- Refer this code for basic syntax and this code for Mutator Example