Interview Questions and Answers for 'Urn' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Urn' - 11 question(s) found - Order By Newest

Very Frequently asked to fresh graduates and less experienced. Favorite question in Walk in drives. Frequently asked in Indian Services companies.
  Q1. Difference between Overloading and Overriding ?Core Java
Ans. Overloading - Similar Signature but different definition , like function overloading.

Overriding - Overriding the Definition of base class in the derived class.

  Sample Code for overloading

  Sample Code for overriding

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   overloading   overriding   oops concepts   basic interview question   overloading vs overriding     Asked in 86 Companies      basic        frequent

Try 1 Question(s) Test


 Q2. what is covariant return type? Core Java
Ans. co-variant return type states that return type of overriding method can be subtype of the return type declared in method of superclass. it has been introduced since jdk 1.5

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   inheritence   overriding   covariant return type   jdk5   advanced     Asked in 3 Companies      expert


Frequently asked in face to face interviews.
  Q3. Write a program to print fibonacci series.Core Java
Ans. int count = 15;
int[] fibonacci = new int[count];
fibonacci[0] = 0;
fibonacci[1] = 1;
for(int x=2; x < count; x++){
fibonacci[x] = fibonacci[x-1] + fibonacci[x-2];
}

for(int x=0; x< count; x++){
System.out.print(fibonacci[x] + " ");
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ebay   fibonacci series     Asked in 66 Companies      basic        frequent


 Q4. What is the difference between URI, URL and URN ?Java EE
Ans. URI stands for Uniform Resource Indicator
URL stands for Uniform Resource Locator
URN stands for Uniform Resource Name

URI = URL + URN

For ex - http://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?keyword=url

This is URI. The string from start till .php is URL whereas keyword=url is URN.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     url  urn  uri  web address  internet address     Asked in 1 Companies


 Q5. What is the use of return statement without any argument ?Core Java
Ans. Such return is only expected in methods that returns void. the purpose of having return in such a method is to return the flow out of method and return to the place where it was called. Its actually used to prematurely return the control from the method.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     return


 Q6. Does it make sense to have return statement at the end of method ?Core Java
Ans. It make sense if its returning something. It doesnt make sense for void methods where return statement is not preceded by anything. In case of void methods , return as last statement has no impact and is actually a overhead.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     return statement  return


 Q7. What is void in Java ? Core Java
Ans. void is a return type which indicates that the method returns nothing but returns the control to the line next to the method call. All methods need to have a return type and hence a method returning nothing needs to be declared void.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     void  return type


 Q8. Does all methods need to have a return type ? Is it applicable to constructors too ?Core Java
Ans. All methods are not expected to return something but Yes, all methods are expected to have a return type. If a method returns nothing, it can be declared with the return type void.

Constructors are not expected to have any return types , not even void.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     return type   method  constructor


 Q9. What is the difference between the 2 methods in Java ?

Class BuggyBread {

BuggyBread(){
}
void BuggyBread(){
}
}
Core Java
Ans. BuggyBread method without any return type is the constructor which get's called upon object creation whereas BuggyBread method with return type of void is just another method that needs to be called explicitly for it's invocation.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     method  return type  constructor


 Q10. What is the difference between return and continue statement ?Core Java
Ans. return is used within a method to return control out of the method. It may be followed by a value which is returned from the method to calling method immediately preceding the point of call.

continue statement is used within a loop to start next iteration without executing the remaining statements in the loop.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     return statement  continue statement  return vs continue  for loop  control statements  loop statement


 Q11. What is the difference between return and break statement ?Core Java
Ans. return is used within a method to return control out of the method. It may be followed by a value which is returned from the method to calling method immediately preceding the point of call.

break statement is used within a loop to move control out of the loop.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     return statement  break statement  return vs break



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: