418
Subscribers
No data24 hours
-27 days
+1230 days
Posts Archive
What is the time complexity for accessing an element in a static array?
What is the output of the following code?
class Test {
private void display() {
System.out.println("Next Coders");
}
}
public class Solution {
public static void main(String args[]) {
Test obj = new Test();
obj.display();
}
}
A) Next Coders
B) Compile-time Error
C) Runtime Error
D) None of the above
Comment Correct Option ⬇️⬇️👇🏻
What is the output of the following code?
class Test {
int i;
}
public class Solution {
public static void main(String args[]) {
Test t;
System.out.println(t.i);
}
}
A) 0
B) garbage value
C) Compile-time Error
D) Runtime Error
Comment Correct Option ⬇️
What is the output of the following code?
class Test { int i; } public class Solution { public static void main(String args[]) { Test t; System.out.println(t.i); } }
Is method overloading possible by changing the return type ❓
SQL Quiz 👩🏻💻👨🏻💻
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 ⬇️
👨💻 SQL Quiz
Which SQL statement is used to remove a record from a table?
A. REMOVE
B. DELETE
C. ERASE
⬇️ Guess the correct option in the comments!
Explain about static nested classes in java ❓
• When a static class is defined inside a enclosing class we define that as nested class.
• Static nested classes are not inner classes.
• Static nested classes can be instantiated without instance of outer class.
• A static nested doesnot have access to instance variables and non static methods of outer class.
https://youtube.com/@codingdrawrun?si=TixFIrdW2zAX3U2M
==============================
YOUTUBE CHANNEL ▶️
'subscribe'
==============================
https://youtube.com/@codingdrawrun?si=TixFIrdW2zAX3U2M
==============================
YOUTUBE CHANNEL ▶️
'subscribe'
==============================
Q. Explain where variables are created in memory ❓
➡️ In Java, variables are created in memory based on their scope and type.
Here's a breakdown:
==============================
🟢 Primitive local variables: Created on the Stack.
- Int, byte, short, long, float, double, boolean, char.
- Stored in the stack frame of the current method.
- Removed from the stack when the method returns.
🟢 Reference local variables: Created on the Stack (reference) and *Heap* (object).
- Objects, arrays, strings.
- Reference (memory address) stored on the stack.
- Actual object stored on the heap.
🟢 Instance variables: Created on the Heap.
- Non-static fields of a class.
- Stored in the heap memory, along with the object instance.
🟢 Static variables: Created on the Method Area (permanent generation).
- Static fields of a class.
- Shared by all instances of the class.
- Loaded into memory when the class is loaded.
🟢 Method parameters: Created on the Stack.
- Passed to a method.
- Stored in the stack frame of the method.
==============================
Note ⬇️
==============================
- Stack: A region of memory that stores data in a Last-In-First-Out (LIFO) order. Used for local variables, method parameters, and method return addresses.
- Heap: A region of memory that stores data in a hierarchical structure. Used for objects, arrays, and strings.
- Method Area: A region of memory that stores class metadata, including static variables.
Will the compiler creates a default constructor if I have a parameterized
constructor in the class ❓
https://youtube.com/@codingdrawrun?si=5CYNjALYVRBODZ_m
Subscribe Our YouTube channel for daily technical quizzes and Interview Questions
GO Community section on youtube and solve daily Quiz
Now I uploaded 'assert' keyword base 3/4 quiz go and choose Correct Option ⬆️⬆️⬆️⬆️⬆️⬆️
