Joined February 2024
Photos and videos
Why are Strings immutable in java? In Java, Strings are immutable, meaning their value cannot be changed after creation. If you modify a string, a new object is created, and the original remains unchanged. Reasons for String immutability⤵️⤵️ #Java #interview #PREPARATION (1/5)
1
1
115
3⃣ Memory Efficiency 🔹String literals are stored in a special pool(String Constant Pool). 🔹If two strings have same value, Java reuses existing object instead of creating a new one. 🔹This saves memory and improves performance. Continued below..⤵️⤵️ #Java #Interviews (4/5)
1
112
Mutable Alternative? 🔹If you need modifiable string, use StringBuilder /StringBuffer. 🔹StringBuilder/StringBuffer uses less memory (modifies existing object) and has better performance (doesn't create new objects) w.r.t string. Please like, share and show your support! (5/5)
95
What is JIT? Just-In-Time (JIT) Compiler, a component of JVM optimizes Java program execution by compiling bytecode into native machine code at runtime. This improves performance by reducing interpretation overhead. Why we Need JIT? How it works? JIT Advantages?⤵️⤵️ (1/5)
1
84
4️⃣ This compiled machine code is then executed directly by CPU, making execution much faster. 5️⃣ The compiled code is cached for reuse, avoiding repeated interpretation. (4/5) #Java #JavaLearning #interview
1
76
JIT Advantages? 1⃣Faster Execution – Converts frequently used code into machine code. 2⃣Optimized Performance – Uses techniques like method inlining, loop unrolling, and dead code elimination. (5/5) Please like, share and follow the account for better learning together. #Java
73
JVM vs JRE vs JDK? JVM (Java Virtual Machine): Executes Java bytecode (.class files) JRE (Java Runtime Environment): Includes JVM libraries for running Java programs JDK (Java Development Kit): Includes JRE compiler development tools (to write Java code) #Java #interview
73
Is Java purely object oriented programming language?Explain: Java is actually not a purely object oriented programming language though it adheres to OOPS Concepts. 1/n
1
155
1)Unlike pure object oriented programming language Java contains primitive data types which are not objects themselves. 2)Certain classes contain static fields and methods which can be accessed without creating an object instance. (2/n)
1
1
151
Conclusion: Java is largely object oriented but contains some non object oriented elements. (3/3)
136