434
订阅者
+124 小时
无数据7 天
无数据30 天
帖子存档
JOIN ➡️ WhatsApp group for internship
==============================
Students who all are joining the session will be getting the Participation Certificates & Chance to Grab Stipend Internship (upto 15k)
Use below link to join the group and circulate the link in your class groups
Group link :
https://chat.whatsapp.com/IBlUB4uMaQo5JmDKILMrqi
Once all the department students are joined we will post all the information in the group
Students who all are joining the session will be getting the Participation Certificates & Chance to Grab Stipend Internship (upto 15k)
Use below link to join the group and circulate the link in your class groups
Group link:
https://chat.whatsapp.com/Gt4hiL0fbkDI69rBmTmiNK
Once all the department students are joined we will post all the information in the group
SQL Quiz 3
Q.Which keyword is used to group rows based on a common column value❓
A. GROUP BY
B. HAVING
C. ORDER BY
Choose Correct Option ⬇️
SQL Quiz
Q.Which keyword is used to filter rows based on a specific condition❓
A. SELECT
B. FROM
C. WHERE
Choose Correct Option ⬇️
Q. What does the gc() Method ❓
The gc() method in Java is used to request the Java Virtual Machine (JVM) to perform garbage collection.
Garbage collection is the process of automatically freeing up memory occupied by objects that are no longer needed or referenced in the program.
When we call gc()
then JVM performs the following tasks ⬇️
==============================
Identifies garba: The JVM identifies objects that are no longer referenced or needed in the programReclaims memory: The JVM reclaims the memory occupied by the identified garbage objectsCompacts memoryryry**: The JVM compacts the memory to remove any holes or gaps created by the garbage objects.
EXAMPLE
==============================
To call the gc() method in a Java program, you can use the following syntax:
System.gc();
⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️
public class Main {
public static void main(String[] args) {
// Create some objectsts**
Object obj1 = new Object();
Object obj2 = new Object();
// Nullify the referenceses**
obj1 = null;
obj2 = null;
// Request garbage collectionon**
System.gc();
// Continue with the programam**
}
}
In this example, we create two objects obj1 and obj2, then nullify their references by setting them to null. We then call System.gc() to request garbage collection, which may reclaim the memory occupied by the two objects.
Also, it's worth noting that you can also use Runtime.getRuntime().gc() to call the gc() method, but System.gc() is a more common and convenient way to do it.
The gc() method is useful in situations where:
===Memory is low*Memory is low**: You can call gc() to free up memory when the program is
Memory leaks: You can call gc() to help identify and fix memory.
Performance optimizatione**: You can call gc() to optimize performance by reducing the number of garbage objects in memory.
However, it's generally recommeJVM handle garbage collection automatically automatically**, as it is optimized to perform garbage collection efficiently. Explicitly calling gc() can sometimes lead to performance issues or interfere with the JVM's garbage collection algorithm.
Q. What does the gc() Method ❓
The
gc() method in Java is used to request the Java Virtual Machine (JVM) to perform garbage collection.
Garbage collection is the process of automatically freeing up memory occupied by objects that are no longer needed or referenced in the program.
**When we call gc()**
then JVM performs the following tasks ⬇️
==============================
Identifies garbagege**: The JVM identifies objects that are no longer referenced or needed in the programReclaims memoryry**: The JVM reclaims the memory occupied by the identified garbage objectsCompacts memoryry**: The JVM compacts the memory to remove any holes or gaps created by the garbage objects.
EXAMPLELE**
==============================
To call the gc() method in a Java program, you can use the following syntax:
System.gc();
⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️
public class Main {
public static void main(String[] args) {
// Create some objectsts**
Object obj1 = new Object();
Object obj2 = new Object();
// Nullify the referenceses**
obj1 = null;
obj2 = null;
// Request garbage collectionon**
System.gc();
// Continue with the programam**
}
}
In this example, we create two objects obj1 and obj2, then nullify their references by setting them to null. We then call System.gc() to request garbage collection, which may reclaim the memory occupied by the two objects.
Also, it's worth noting that you can also use **Runtime.getRuntime().gc()** to call the gc() method, but **System.gc()** is a more common and convenient way to do it.
**The gc() method is useful in situations where:**
==================Memory is low*Memory is low**: You can call gc() to free up memory when the program is running low oMemory leaks**Memory leaks**: You can call gc() to help identify and fix memory leaks in yPerformance optimizatione optimization**: You can call gc() to optimize performance by reducing the number of garbage objects in memory.
However, it's generally recommeJVM handle garbage collection automatically automatically**, as it is optimized to perform garbage collection efficiently. Explicitly calling gc() can sometimes lead to performance issues or interfere with the JVM's garbage collection algorithm.==============================
🔵 One Short knowledge 🔵
==============================
Collections
==============================
Collection is a group of objects which can be represented as a single unit. Collections are introduced to bring a unified common interface to all the objects.
Collection Framework was introduced since JDK 1.2 which is used to represent and ~manage Collections~ and it contains:
🔵 Interfaces
🟤 Classes
🟢 Algorithms
This framework also defines map interfaces and several classes in addition to Collections.
Advantages
==============================
• High performance
• Reduces developer's effort
• Unified architecture which has
• common methods for all objects.
OOPS concept Playlist
https://youtube.com/playlist?list=PLzc94bVR_krnn2ICMQIBtWDjff6F8yppV&si=JIQpIYydXGarTKEi
👨🏻💻👩🏻💻Java Datatype Quiz
What is default value of Integer ❓
A) null
B) 0
C) 1
Choose Correct Option ⬇️
👨🏻💻👩🏻💻Java Datatype Quiz
What is default value of int ❓
A) null
B) 0
C) 1
Choose Correct Option ⬇️
👨🏻💻👩🏻💻Java Datatype Quiz
What is default value of String ❓
A) null
B) blank('\u0000')
C) '0'
Choose Correct Option ⬇️
👨🏻💻👩🏻💻Java Datatype Quiz
What is default value of char ❓
A) null
B) blank('\u0000')
C) '0'
Choose Correct Option ⬇️
In This website available All Cheatsheet with code and basic to advanced course available free
Memory Consistency Errors
==============================
Memory consistency errors occur when different threads have inconsistent views of what should be the same data.
OR
(( A memory consistency error occurs when the Java Virtual Machine (JVM) does not ensure that changes made by one thread are visible to other threads in a timely manner. This can lead to unexpected behavior, as threads may see stale or inconsistent data.))
Memory consistency errors can occur due to:
==============================
🔵 Lack of synchronization: Threads accessing shared variables without proper synchronization.
🔵 Inadequate volatile declaration: Failing to declare shared variables as
volatile, which ensures changes are always visible to other threads.
🔵 Compiler optimizations: The JVM or compiler reordering operations, which can lead to inconsistent memory visibility.
To avoid memory consistency errors:
==============================
🟢 Use synchronization: synchronized blocks or methods to ensure exclusive access to shared variables.
🟢 Declare shared variables as volatile: Ensure changes are always visible to other threads.
🟢 Use atomic variables: java.util.concurrent.atomic package provides thread-safe classes for shared variables.