File Name: tough java interview questions and answers .zip
Download PDF We have compiled the most frequently asked Java Interview Questions and Answers that will help you prepare for the Basic Java interview questions that an interviewer might ask you during your interview. In this list of Basic Java interview questions, we have covered all commonly asked basic and advanced Core Java interview questions with detailed answers to help you clear the job interview.
Explore Now! Are Looking for Java Training? For More Details Call Now!
What is the right data type to represent a price in Java? Answer: BigDecimal, if memory is not a concern and Performance, is not critical, otherwise double with predefined precision. What is a class in Java?
Thanks a lot Anonymous for informing us about subtle details about Substring method , I guess Interviewer was looking for that information in his question "How does substring inside String works? Hi Scott, your solution is correct but with the advent of java 5 and now guarantee of volatile keyword and change in Java memory model guarantees that double checking of singleton will work.
Hi Anand, Thanks for answering question "How does substring inside String works? Use can use a static holder to handle the singleton creation instead of double checked mechanism. Stored Procedure Error: One way to signal an error is from what is returned. Consider different factories each extended from an Abstract Factory and responsible for creation of different hierarchies of objects based on the type of factory.
Each individual factory would be responsible for creation of objects in that genre. I only see 18 questions and most of them are answered wrong or not at all Also, your english is terrible. If found s will be made to refer to the found object. If not found, a new String object is created, added to the pool and s is made to refer to the newly created object. Additionally an entry for string "Test" is made in the string constant pool, if its not already there. So assuming string "Test" is not in the pool, the first declaration will create one object while the second will create two objects.
Factory just create one of the subclass. As I remember in GoF: AF could create widgets for different types of UI buttons, windows, labels , but we could have windows, unix etc.
UI types, created objects are related by domain. PS full disclosure, I am actually a current student of IIB and I do receive help with recruiting eg mock interview in exchange for letting other students know about the Free Tutorials. These Java interview question are equally beneficial for 2 years experience or beginners, 4 years experience Java developers intermediate and more than 6 years experience of Java developer i.
Advanced level. Most of the questions comes under 2 to 4 years but some of them are good for 6 years experience guy as well like questions related to executor framework. I agree most of these java interview questions asked during experienced developers and senior developers level. Another popular Java interview question is why Java does not support multiple inheritance, passing reference, or operator overloading, can you please provide answers for those questions.
Hi I am looking for some real tough Java interview question which explores some advanced concept and make sense. If you have Java questions asked in Nomura or any of these banks please share.
I heard that they mostly asked Garbage Collection, Generics, Design and profiling related questions to senior candidate but some real questions from those companies will really help. Hi Javarevisited, looking core java interview questions and answers for experienced in pdf format so that I can use if offline, Can you please help to convert these Java questions in pdf?
Javin For question 7 -we usually handle the exception and divert the user to a standard error page with the exception trace as a page variable. The user will have an option to email the support team through a button click and the error trace gets sent to support. This way we can know what went wrong in the application and fix it.
Typically these kind of errors are due to poor data error handling in stored procedure like a missed null check or a char variable of incorrect size etc which are exposed only when I consistent data flows into the app which was never tested during development or uat.
Anand, you bring an important point. I guess purpose of that java interview question is to check whether you verify inputs in Java or not before passing to Stored procedure and similarly when you receive response. Thanks for your comment mate. Please keep us posting some more tough Java interview question from and , which is recent. Urgently required, interview scheduled in two days. Some Java programmer ask for Java questions for 2 years experience, Java questions for 4 years experience, questions for Beginners in Java, questions for experienced Java programmer etc etc.
Basically all these are just short cut, you should be good on what are you doing. You automatically gain experience while working in Java and should be able to answer any Java question up-to your level. Hi , Does Amazon or Microsoft ask questions on Java? I am looking for some Java questions asked on Microsoft, Amazon and other technology companies, if you know please share.
You have no control over what questions get asked in job interviews. All you can do is brush up on the key fundamentals. Hi Javin, I'd like to thank you for putting huge effort in creating such nice collection. Kindly update following in your blog: Regarding Question It will be nice for others if you can update this in your blog. Hi Ravi, where did you read that?
I have never heard about String object created on both heap and pool. Object is placed into pool when you call intern method on String object.
Can you please suggest some latest Java interview questions from , and what is trending now days. Questions like Iterator vs Enumeration is way older and I think latest question on Java is more on Concurrency. In addition, the literal "Test" will be placed in the pool. Although, questions are good, you can add lot more interview questions form Java 5, 6 and Java 7.
Even lamda expression from Java 8 can be a nice question. I remember, having interview with Amazon, Google and Microsoft, there were hardly any Java question, but when I interviewed by Nomura, HeadStrong, and Citibank, there are lots of questions from Java, Generics, Enum etc.
Lesson learned, always research about what kind of question asked in a company, before going to interview. I am preparing for Java interview, and looking for recent questions asked in , or may be in last couple of month.
If you can get question from Singapore, HongKong or London, that would be really helpful, but I don't mind question form Pune, Bangalore or Mumbai even. Cheers Dheeraj. Hi, for number 19 it might be better to use System. I think, you should also include questions from Garbage Collection tuning, Java concurrency package, very hot at the moment.
What is the difference between creating String as new and literal? India is mostly about theoretical knowledge e. USA in particular is more about Code, they will give you a problem and ask you to code solution , write unit test, produce design document in limited time usually 3 to 4 hours.
Trends on other countries are also more balanced towards code e. I heard they are asking new features introduced in Java 6 as well as Java 7. Please help. How HashMap works, this question was asked to me on Barclays Capital Java Interview question, would hae read this article before, surely helped me. On the contrary,when we invoke intern method on s1 and then compare it returns true as it adds string to pool which is normal working of intern method.
Please correct me if I am wrong. I have an interview with Citibank Singapore for Algorithmic trading developer position, and expecting few Java questions? Nikhil: Question 19 To find out time taken by method to execute System. I am copying and pasting same here.. In this simple case, "abc" will go in the pool and s will refer to it. In this case, because we used the new keyword, Java will create a new String object in normal nonpool memory, and s will refer to it.
In addition, the literal "abc" will be placed in the pool. These questions are quite basic and only useful for freshers or beginners Java developers. I wouldn't say, you can expect this question as Senior Java developer. Everyone knows answers, there is nothing special about it.
I agree with Xhotery, this questions are from and years, now it's In order to crack Java interview today, you need to focus extensively on JVM internals, deeper knowledge of Java Concurrency, sophisticated open source library and good knowledge of frameworks like Spring, Hibernate, Maven, and even bit of functional programming knowledge is required. In recent Java interviews, peoples are asking about lambdas of Java 8 and How it's going to improve performance, questions about functional interface and new date and time library.
Even questions from Java 7 e. So be more advanced and prepare relevant questions, which is popular in , not two years back. These questions and answers are ok, but they look more suited for junior developers than senior engineers to me.
Just few quick remarks from me: 1. Immutability in Java is not that easy to achieve, as long as we have reflexion. Of course, in theory, reflexion can be disabled from a security provider. But in practice, a Java application uses several technologies that rely on reflexion anything that does dependency injection Spring, EJB containers etc.
In Java a java-core environment, singleton means single instance per class loader not per application! In other contexts it may mean single instance per container, etc.
Your answer here is absolutely wrong. On one hand, if you just invoke that method for the very first time, you'll not find the net amount of time taken by method execution, but the gross amount of time including method execution plus class loading time for all classes that are referred for the first time inside that method.
Second thing, by measuring that way, you completely ignore how java works: all the adaptive optimization the JIT does at runtime dramatically changes the execution time after a number of method calls. Actually, the first call of a method is the wrongest way to measure its execution time. Reference : Effective Java second edition item 5 or 6 It will be nice for others if you can update this in your blog. Hi, The Answer to 3. When creating string using new will create two copies one in heap and another in string pool.
And the object reference will be initially in heap. Inorder to make the object reference to string pool we need to call intern on the string.
Very very good compilation of all good questions.. Wish me luck for my interviews.. Most of the tough questions I faced on programming interviews are from Data Structure and algorithm. Only difficulty arise on complex Java topics like classloaders, socket programming and multithreading. Since, no body ask question from Swing or AWT, those are useless topics to prepare for Java interviews. I conduct a lot of Java interviews, and I wouldn't ask more than one or two of these questions. How many people use serialization?
Thanks a lot Anonymous for informing us about subtle details about Substring method , I guess Interviewer was looking for that information in his question "How does substring inside String works? Hi Scott, your solution is correct but with the advent of java 5 and now guarantee of volatile keyword and change in Java memory model guarantees that double checking of singleton will work. Hi Anand, Thanks for answering question "How does substring inside String works? Use can use a static holder to handle the singleton creation instead of double checked mechanism. Stored Procedure Error: One way to signal an error is from what is returned.
Basic Core Java Interview Questions: Q1. What is the difference between an Inner Class and a Sub-Class? Ans: An Inner class is a class which.
I was getting a lot of emails and comments to create java interview questions and answers PDF eBook. Below image shows the cover page of this eBook. Just subscribe to my newsletter and you will get this eBook first thing in the email. So go ahead, subscribe from any of the forms on the website and get this eBook too.
These are the most asked interview questions for freshers years experienced. This question list will help you to crack java interview. I have already shared detailed answer over here before, you might find it helpful as well.
То, что Хейл мог его угадать, было исключено: число комбинаций составляло тридцать шесть в пятой степени, или свыше шестидесяти миллионов. Однако в том, что команда на отпирание действительно вводилась, не было никаких сомнений. Сьюзан в изумлении смотрела на монитор. Хейл влез в ее компьютер, когда она выходила. Именно он и подал ручную команду на отзыв Следопыта. Вопрос насколько .
Алькасар. Беккер снова кивнул, вспомнив ночь, когда слушал гитару Пако де Лючии - фламенко под звездами в крепости XV века. Вот бы побывать здесь вместе со Сьюзан. - И, разумеется, Христофора Колумба? - просиял лейтенант. - Он похоронен в нашем соборе.
Отключение ТРАНСТЕКСТА было логичным шагом в случае возникновения чрезвычайной ситуации, а ведь тот был уверен, что в машину проник вирус. К несчастью, это был самый надежный способ собрать в шифровалке всех сотрудников Отдела обеспечения системной безопасности. После таких экстренных действий на главном коммутаторе раздавался сигнал общей тревоги.
Подите к черту. - Очень остроумно. - Вы болван, Стратмор, - сказал Хейл, сплюнув. - К вашему сведению, ваш ТРАНСТЕКСТ перегрелся. - Что ты говоришь? - засмеялся Стратмор.
Вы промыли ей мозги. Вы рассказываете ей только то, что считаете нужным. Знает ли она, что именно вы собираетесь сделать с Цифровой крепостью. - И что. Хейл понимал: то, что он сейчас скажет, либо принесет ему свободу, либо станет его смертным приговором.
Он гулял в парке с подружкой. Беккер понял, что с каждой минутой дело все больше запутывается. - С подружкой.
ТРАНСТЕКСТ стонал, его корпус готов был вот-вот рухнуть. Голос Дэвида точно вел ее, управляя ее действиями. Она бросилась к лестнице и начала подниматься к кабинету Стратмора.
Танкадо задыхался, явно стараясь что-то сказать добрым людям, склонившимся над. Затем, в отчаянии, он поднял над собой левую руку, чуть не задев по лицу пожилого человека. Камера выхватила исковерканные пальцы Танкадо, на одном из которых, освещенное ярким испанским солнцем, блеснуло золотое кольцо. Танкадо снова протянул руку.
Понятия не имею. - Парень хмыкнул. - Меган все пыталась его кому-нибудь сплавить. - Она хотела его продать.
Fundamentals of pharmacology for veterinary technicians pdf english for academic purposes textbooks pdf