Java - Online Test - Memory - javasearch.buggybread.com


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'Memory' - 13 questions found


Function variables are kept in ..Core Java
Stack
Heap
Both Stack and Heap
None of them

  memory management  stack  heap

Which memory segment holds String Pool ?Core Java
Stack
Heap
Code Segment
Class Segment

  memory management  string pool

In this code

public class BuggyBread1{
   private static String staticVariable = "static Variable";
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = "local Variable";
}
}

Where will the value 'static Variable' be stored ?
Core Java
Stack Memory Segment
Heap Memory Segment
Runtime Constant Pool within Heap Segment
Code Segment

  memory manegement

In this code

public class BuggyBread1{
   private static String staticVariable = "static Variable";
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = "local Variable";
}
}

Where will the value 'static Variable' be stored ?
Core Java
Stack Memory Segment
Heap Memory Segment
Runtime Constant Pool within Heap Segment
Code Segment

  memory management

In this code

public class BuggyBread1{
   private static String staticVariable = "static Variable";
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = new String("local Variable");
}
}

Where will the value 'local Variable' be stored ?
Core Java
Stack Memory Segment
Heap Memory Segment
Runtime Constant Pool within Heap Segment
Code Segment

  memory management

In this code

public class BuggyBread1{
   private static String staticVariable = new String("static Variable");
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = "local Variable";
}
}

Where will the value 'static Variable' be stored ?
Core Java
Stack Memory Segment
Heap Memory Segment
Runtime Constant Pool within Heap Segment
Code Segment

  memory management

Which of following memory segment is cleaned by Garbage Collection Mechanism ?Core Java
Stack
Heap
Code
Cache

  memory management  garbage collection

When String literals are compared using ==, they always returns true if the string values are same because .. Core Java
of overridden compareTo method
of overridden compare method
of String Pool
== means that the object contents are equal

  

What will be the output of following code ?

String str1 = "String1";
String str2 = "String2";
str1.concat("String3");
System.out.print(str1);
System.out.print(str2);
Core Java
String1String2
String1String3String3
String1String3String1String3
String1String1

  

Which of the following methods are used by Java Garbage Collection Mechanism ?Core Java
final
finally
finalize
All of the above

  garbage collection  finalize

Which of the following about Garbage collection is false ?Core Java
We can call Garbage collection explicitly
Garbage Collection guarantees that the application will not run out of memory
finalize method is used by Java for Garbage Collection
Garbage Collection Mechanism delete unclaimed objects that are no longer required

  garbage collection

What kind of thread is Garbage collection thread ?Core Java
Daemon Thread
User Thread
System Thread
Active Thread

  garbage collection  thread type

Which of following is Daemon Thread ?Core Java
Thread Scheduler
Daemon Thread
Both of above
None of above

  daemon thread   threads







comments powered by Disqus