Java Fundamentals Java: Java is a programming language, platform & technology. Java is called as programming language because by using Java we can write programs. Platform: It can be a software or hardware environment in which program runs. C compiler converts unicode into bit code whereas Java compiler converts unicode into byte code. JVM: JVM stands for Java Virtual Machine. It contains interpreter which converts byte code into bit code. Both compiler & interpreter are called translation softwares. Differences between compiler & interpreter: Compiler converts the whole program at a time whereas interpreter converts line by line. Compiler will produce the file whereas interpreter does not produce the file. C is a platform dependent whereas Java is a platform independent. Java is called as platform independent because programs written in Java language can be executed on any platform. Java Virtual Machine(JVM) is not a platform independent...
Posts
Multithreading & Synchronization
- Get link
- X
- Other Apps
Multithreading: Execution of more than one thread at a time is called as multithreading. Thread: A thread is a piece of code that executes independently. Every program contains at least one thread. i.e. main thread Main thread default name is main only. Main thread default priority is normal priority(Priority number is 5) There are two ways to create a new thread: 1) By extending java.lang.Thread class 2) By implementing a java.lang.Runnable interface Life cycle of a thread (or) thread states: Whenever thread class constructor is called new thread will born. Thread comes to a ready state whenever start() method is called. Thread will run whenever run() method is called. Thread comes to a sleeping state whenever sleep() method is called. Sleeping thread will wake up automatically whenever time interval is finished. Thread is suspended whenever suspend() method is called. Suspended thread will run whe...
Collections Framework
- Get link
- X
- Other Apps
Collections Framework: A set of collection classes and interfaces is called as collections framework. (or) A set of data structures related classes and interfaces is called as collections framework. Collection: A collection is an object that represents group of objects. Data Structures: Arranging data in different formats is called data structures. Advantages of Collections Framework: 1) Reduces programming effort 2) Increases programming speed & quality 3) Allows interoperability among unrelated APIs. Collection classes & interfaces are the part of java.util package. java.util package classes & interfaces are divided into two categories: 1) Collecti...