What is JAVA ?
Java is a high level , popular, object oriented programming language , it’s purpose is : WORA (Write Once , Run Anywhere) , that means compiled java code can run in any plateform without the need to recompile it again
Java Features
Java’s release date
1995
Java’s original name
oak
Java Platforms (editions)
multitasking vs multiprocessing vs multithreading
multitasking : the ability of OS to execute multiple task simultaneously . there two type of multitask :
*multiprocessing : you can run multiple process and programs that doesn t share the same cpu and memory space (more isolated than threads) which make multiprocess a resource-intensive . it s good for CPU-BOUND where each process run in parallel on a different CPU cores.
*mutithreading : run mutliple thread with the same memory space and cpu (single process) which make communication / switch between threads more easier and lightweight.
=> Java have built-in support multihreading with Thread Class and Runnable Interface
BUT doesn t have built-in support multiprocessing , you can run java applications separately or use libraries for inter-process communication (IPS) if needed.
C++ Features
Java vs C++
*Libraries:
Java:don t support it directly, but we can configure it using 3rd party libraries.
C++:support direct system library calls.
*Multiple inheritance:
JAVA: support only single inheritance.
C++ : support multiple inheritance because of the ‘virtual’ keyword
*Mutithreading:
JAVA: support it.
C++:don t , but can by using 3rd party libraries.
*Pass by value/reference :
Java : Java support pass by value only , both in primitive type and also in object reference.
C++: support pass by value , and pass by reference using the pointer &.
What is difference between pass by reference and pass by value ?
On Pass by Value , we pass a copy of the value.
But on Pass by Reference we pass the same reference.
JVM Architecture
What JDK, JRE and JVM ?
How much variables java has ? and what is it ?
How much modifiers java has ? and what is it ?
Java Data types
Java type casting (type conversion)
Java Generics
Are methods and classes that we use for different types without writing it again.
What is difference between Functional programming vs OOP ?
=> In functional programming we focus on pure functions ,state immutability(stateless),and using features like lambdas and stream for declarative logic.
It is used when we have parallel operations and data processing
=> For OOP , we focus on using object and classes ,mutable state(stateful) and concepts like abstraction , polymorphism , encapsulation , inheritance + imperative logic
=> it is used for data modeling and need of principes like inheritance …