Java - Online Test - Bank of america - javasearch.buggybread.com


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'Bank of america' - 16 questions found


Which of the following is wrong for final instance variables ?Core Java
They cannot be changed after initialization
They can be initialized directly within static method
They can be declared and initialized together at the same place
They can be initialized within constructor

  java  final  final variable  java keywords

Which of the following is false for final ?Core Java
Final methods cannot be overriden
Final methods cannot be overloaded
Final classes cannot be subclassed
Final class cannot be abstract

  java  final  java keyword

Which of the following statement is not true ?Core Java
x==y means they are pointing to the same object
x==y means that they hold same information
x.equals(y) means they are pointing to the same object
x.equals(y) means that they hold same information

  

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 ?

String str1 = new String("String1");
String str2 = new String("String1");
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2);
Core Java
falsetruetrue
truetruetrue
truetruefalse
falsetruefalse

  equals  object equality

What will be the output of following code ?

String str1 = "String1";
String str2 = "String1";
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2);
Core Java
falsetruetrue
falsefalsetrue
truetruetrue
falsefalsefalse

  equals  object equality  string pool

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

  

What will be the output of following code ?

String str1 = "String1";
String str2 = "String2";
str1=str1.concat("String3");
System.out.print(str1);
System.out.print(str2);
Core Java
String1String2
String1String3String2
String1String2String3
String1Stringg3String1

  

What is Lazy Initialization in Hibernate ?Hibernate
Feature to load the dependencies from Cache
Feature to load all objects and relationships in advance before they can be used
Feature to not load dependencies and relationship in advance and load when required
Feature to not load the dependencies and relationships at all

  Lazy Initialization

Which of the following is not the benefit of Lazy Initialization in Hibernate ?Hibernate
Laod When required provides better performance
Object stays lighter
Less number of Database calls
Less load on Database

  Lazy Initialization  Lazy Fetching

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

In which case finally won't get executed ?Core Java
in case of exception
in case of normal execution
in case of return statement before end of try block
in case of force program termination

  finally

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

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

  memory management  garbage collection







comments powered by Disqus