interview Questions - 01-02-18

Deloitte
======
1. explain oops concepts
2. use of abstract methods
3. abstract class A{
    public void a1(){
        System.out.println("abstract");
    }
}
class B extends A{
    public void a1(){
        System.out.println("child");
    }
}


public class abstractTest{
 public static void main(String[] args) {
A a=new B();
a.a1();
 }
}
which one executed
4. string s="abc"
string s1=new String("abc")
out put of s==s1
5.hashset implementation
6.   concurrent modification exception  , how they implemnted
7. can we handle errors? how?
8.class A{
int i=10;
}
class B extends A{
int i=20;
}
public class test{
PSVM(){
A a=new B();
sysout(i);
}
}
tell me output

Round 2:
========
1. count words in given string
2. Spring bean life cycle
3. project architecture
4. anonymous inner class


Varite
=========
1. write program find a angle based on given time
2. String s="BANGALORE"
replace with A to X, use any this methods indexOf(),length(),Substr()
ANS:
public class replaceString {
 public static void main(String[] args) {
  String str="BANGALORE";
  String str2="A";
 
         for (int i = 0; i < str2.length(); i++) {
             str = str.replace(str2.charAt(i),'X');
          }


         
          System.out.println(str);
   
 }
}

3. design api , near to your location find any shopping malls and if any discounts are available for that shops give alerts to end user
4. why we are using spring, if we use spring  wt is the use for end user 

Comments