SoMiE
BAN USER- -3of 3 votes
Answersclass Test { public void m1(String arg1){ arg1 = "Am I going to disappear?"; } public static void main (String[] args) { Test test = new Test(); String iAmOfAnArgumentativeNature = "I am born new"; m1(iAmOfAnArgumentativeNature); System.out.print(iAmOfAnArgumentativeNature); } }// end class
What is the output?
- SoMiE in India| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - 1of 1 vote
AnswersImplement Object Pool for database connections in the following interface
interface Pool{ public Connection get() public void put(Connection c) }
It should have object pool characteristics.
- SoMiE in India
Hint - The emphasis is on which data structure you will use to achieve this.| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Data Structures - 0of 0 votes
AnswersIf a java class has methods declared
as followsclass A public synchronized void m1() { //whatever code } public synchronized void m2 { // whatever code } // note that return type is not relevant here.
if a class is created with A a = new A() and
- SoMiE in India
if a thread T1 is executing a.m1 and another thread T2 wants to execute a,m2 - what will happen?| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - -3of 3 votes
AnswersA set of milk containers has capacities of 5, 4, 3, 2 , 1 etc . Lets say X containers
- SoMiE in India
There is another set of Y containers
If you are going to transfer water from one to the other and each transfer has a fixed cost C, evaluate and state the complexity of the algorithm to achieve a least cost transfer.| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Algorithm
The intent of the interviewer is certainly Reflection, but you can serialize the object and calculate the number of bytes stored, as well. The same approach should work for different objects and give a relative "size" which can then be compared.
The writeObject method should be overridden such that only the member variables of the object are serialized. (Since we are talking about containers). Then a bytecount would return reliable comparison results. This should work since all objects are custom serialized the same way,
Just food for thought.
RepIn 2008 I was licensing race cars in Los Angeles, CA. What gets me going now is promoting husband vashikaran ...
Repkaylafgioia, Cloud Support Associate at Absolute Softech Ltd
Hi, I am Kayla from Elkins USA. I am working as Project management and I have professional 3-year experience in ...
RepOliviaJBlack, Consultant at Apkudo
I am Olivia from San Diego. I am working as a checker in the Thom McAn Store company. My strong ...
RepShastri Ji is well known hindi and tamil vashikaran specialist. He will give you effective and simple totke to control ...
Repleancpuryear, Data Scientist at Adjetter Media Network Pvt Ltd.
Hi guys!! My name is Lean C Puryear and I love fashion, I hope to some day get into the ...
RepShirleyCWest, Software Engineer at Agilent Technologies
Hello, me Shirley and I from Savage. I am an artist and I love to doing art and I am ...
RepRebecaMoore, Consultant at AMD
I am working as an art teacher with “Glory High School,” and develop interests for art and creative expression in ...
Not sure how does HashMap solve the problem. "Connection Pool" behaviour?
- SoMiE July 11, 2013Note: *I don't need this question answered*