Interview generally starts with:
*
Tell me about yourself.
* Tell
me about your current project and your role in it. And few related questions on
project, if he gets what you have explained.
Then
they start with core java. Be very much perfect in core java concepts, because
this is the section which will decide your fate in interview. Even if you suck
at j2ee part, and if you are very much good at core java concepts then consider
you are almost in. Best book I suggest for core java preparation is SCJP (OCJP)
by Kathy Sierra. And following are few
important questions for your quick review.
Key point to remember: Do not answer the question if you don’t know
the answer. It’s better than answering it wrong.
Core Java interview questions for experienced developer:
- Explain OOPS concepts with example.
- What is difference between abstraction and encapsulation?
- What is difference between abstract class and Interface?
- What is polymorphism? Explain with example.
- Can we override static method?
- Can we overload the static method?
- What is base class of java?And what methods it provides? Ans: It's Object and methods are : Clone(), equals(), hashCode(), finalize(), notify(), notifyAll(), wait(), toString()
- How variables are defined in interface and how to access it?
- Explain System.out.println() in detail
- What is final object in java?
- What is static import in java?
- What is agreement between equals() and hashcode() methods in java?
- What will print on console, if I don’t override toString() method and I pass object to System.out.println()? Ans: If you don’t override toString() method & pass object to System.out.println(), then it will print classname followed by @ symbol, followed by unsigned hexadecimal representation of objects hashcode.
Now as you are 3+ years of experience, generally interviewers don’t ask you direct question. They might ask you to consider a scenario and asks questions in-between or expect you to correct him, if he is going wrong somewhere. Consider the following scenarios:
Scenario 1:
I have two classes A & B. Where class B extends class A.
And now I’m having one more Test class, to test it. Now I have created one
reference of class B and provide it object of class A. Like,
B obj = new A();
Here, he expects you to correct him, that you cannot store
object of parent class into reference of base class.
Scenario 2:
File name: Test.java
class A{
String
name = "Parent
Class";
public void printMe(){
System.out.println("This is
parent class");
}
}
class B extends A{
String
name = "Base
Class";
public void printMe(){
System.out.println("This is
base class");
}
}
public class Test {
public static void main(String[]
args) {
A
objA = new B();
System.out.println("Name is
:"+objA.name);
objA.printMe();
}
}
Now when I run this test class, what will be the output?
Output:
Name is :Parent Class
This is base class
Now few things to learn here:
#
Java file may contain more than one class
classes, but only one public class. And this public class name should be same
as that of file name.
#
Java provides method overriding but not variable
overriding. That is why, when I print variable name, it will pick up the
variable definition from the class of which reference is created i.e. A. And
method of the class of which object is created i.e. B.
Interview question on String class in Java:
- What is difference between String, StringBuffer and StingBuilder? In what scenarios they should be used?
- What is String.intern() method?
- What is mutable and immutable class? Where does String class belongs to? How to write immutable class
- What will be output for following:
String a = "abc";
String b = "abc";
String c = new String("abc");
String d = new
String("abc");
if(a==b)
System.out.println("a==b");
if(a==c)
System.out.println("a==c");
if(c==d)
System.out.println("c==d");
if(a.equals(b))
System.out.println("a equals
b");
if(a.equals(c))
System.out.println("a equals
c");
if(c.equals(d))
System.out.println("c
equals d");
Output:
a==b
a equals b
a equals c
c equals d
Important point about String, you should know:
- String is final class, this means you cannot extend it or inherit it.
- String is immutable. This means, every time you assign value to it, it will be stored at new memory location.
- Whenever we assign value to String variable directly using double quote (without new keyword), it will check for that value in String pool and if it exists, it directly reference to that memory location without creating new one.
- And whenever we use new keyword, it creates new memory location to store that object.
- As we know == checks for memory location to compare, it will not return true for a==c & c==d (.equals() method checks for value in object)
Interview question on Serialization in Java:
- What is serialization? Why we use it? How did you use it? Short Ans : The primary purpose of serialization is to write an object into a stream, so that it can be transported through network and object can be rebuild from it on the other end. And other purpose is to store state of object and retrieve it back. Or you can say to persist the object across the sessions.
- I serialize the object which contains reference of non serialized object? Ans: No, it will throw nonSerializableException
- Explain steps of serialization
- What are transient variables? Give real time example. Ans: Variables which you don't want to serialized are marked as transient. Example age in student object is kept transient, so as to it will be calculated on the basis of its birth date and current date comparison.
- Can we mark method as transient ? Ans: No
wow really nice. It will be helpful for the people those who are ready to crack the interview and please also for remind what they have learned throughout concept.
ReplyDeleteSEO Training in Chennai
really nice...
ReplyDeleteios training in chennai
Excellent post!!!
ReplyDeleteunix training in chennai
I am so grateful for your article.Really thank you! Really Cool.
ReplyDeleteSelenium Online Certification Training Course for Professional
Hadoop Online Training Material From Hyderabad India
Learning new technolgy would help oneself at hard part of their career. And staying updated is the only way to survive in current position. Your content tells the same. Thanks for sharing this information in here. Keep blogging like this. Android Training in Chennai
ReplyDeleteThe Spring Framework is a lightweight framework for developing Java enterprise applications. It provides high performing, easily testable and reusable code. Spring handles the infrastructure as the underlying framework so that you can focus on your application.Spring is modular in design, thereby making creation, handling and linking of individual components so much easier. Spring implements Model View Container(MVC) design pattern.
ReplyDeletespring mvc validation example
Thanks for sharing this good blog.This is very important and imformative blog for Java . very interesting and usefulblog
ReplyDeleteJava Online Training Hyderabad
This comment has been removed by the author.
ReplyDeleteI read your blog it's really good, thanks for sharing valuable information with us.
ReplyDeleteExcellent Article, Nice to read your article, very informative.
Excellent article Top AC mechanics Professional Camera sellers ChennaiCatering Service in ChennaiTop Educational Institute Chennai
Excellent Article
swimmingpool contractor chennai
swimmingpool equipment dealer chennai
swimmingpool consultant chennai
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
ReplyDeleteBest Java Training Institute Chennai
Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
ReplyDeleteamazon-web-services-training-institute-in-chennai
Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
ReplyDeletehttps://bit.ly/2JbBPth
I think you have a long story to share and i am glad after long time finally you cam and shared your experience.
ReplyDeletepython training in chennai | python training in bangalore
python online training | python training in pune
python training in chennai | python training in bangalore
python training in tambaram
Outstanding blog post, I have marked your site so ideally I’ll see much more on this subject in the foreseeable future.
ReplyDeletejava training in chennai | java training in bangalore
java online training | java training in pune
Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
selenium training in chennai
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleterpa training in Chennai | rpa training in pune
rpa training in tambaram | rpa training in sholinganallur
rpa training in Chennai | rpa training in velachery
rpa online training | rpa training in bangalore
Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.
ReplyDeletepython training in rajajinagar
Python training in btm
Python training in usa
Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
ReplyDeleteDevOps online Training
DevOps Training in USA
Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
ReplyDeleteBest Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies
Selenium Training in Bangalore | Best Selenium Training in Bangalore
AWS Training in Bangalore | Amazon Web Services Training in Bangalore
Excellent way of expressing your ideas with a clear vision, Keep updating
ReplyDeleteselenium Training in Chennai
Selenium Training Chennai
ios training institute in chennai
ios developer training in chennai
Android Course in Chennai with Placement
Android Training Center in chennai
Thanks for sharing this valuable information to our vision. You have posted a worthy blog keep sharing.
ReplyDeleteGuest posting sites
Technology
Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in
ReplyDeleteJava training in Bangalore | Java training in Marathahalli | Java training in Bangalore | Java training in Btm layout
Java training in Bangalore | Java training in Marathahalli | Java training in Bangalore | Java training in Btm layout
ReplyDeleteGreat and Informative Blog. Your style of writing is very unique. Thanks for Posting.
IELTS coaching in Chennai
IELTS Training in Chennai
IELTS coaching centre in Chennai
Best IELTS coaching in Chennai
IELTS classes in Chennai
Best IELTS coaching centres in Chennai
IELTS Centre in Chennai
Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
ReplyDeleteBest Devops Training in pune | Java training in Pune
Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
ReplyDeletePython training course in Chennai | Data science training in pune | Data science online training
feeling so good to read your information's in the blog.
ReplyDeletethanks for sharing your ideas with us and add more info.
german language tutorial in bangalore
best german language course in bangalore
German Training in Anna Nagar
German Training in Nungambakkam
Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.
ReplyDeleteNo.1 AWS Tutorial |Learn Advanced Amazon Web Services Tutorials |Best AWS Tutorial For Beginners
Advanced AWS Training in Chennai |Best Amazon Web Services Training in Chennai
Advanced Amazon Web Services Training in Pune | Best AWS Training in Pune
Thanks for taking time to share this valuable information admin. Really informative, keep sharing like this.
ReplyDeleteAWS Training in Chennai
AWS course in Chennai
AWS Certification in Chennai
AWS Course
Azure Training in Chennai
RPA Training in Chennai
You have provided a nice article, Thank you very much for this. I hope this will be useful for many people. Please keep on updating these type of blogs with good content.Thank You...
ReplyDeleteaws online training
aws training in hyderabad
amazon web services(AWS) online training
amazon web services(AWS) training online
Nice blog..! I really loved reading through this article. Thanks for sharing such
ReplyDeletea amazing post with us and keep blogging...Well written article Thank You for Sharing with Us pmp training Chennai | pmp training centers in Chenai | pmp training institutes in Chennai | pmp training and certification in Chennai | pmp training in velachery
Awesome Post. The content show cases your in-depth knowledge. Thanks for Sharing.
ReplyDeletePrimavera Training in Chennai
Primavera Course in Chennai
Primavera Software Training in Chennai
Best Primavera Training in Chennai
Primavera p6 Training in Chennai
Primavera Coaching in Chennai
Primavera Course
ReplyDeletethanks for giving that type of information. ielts coaching in gurgaon
You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us
ReplyDeleteangularjs Training in bangalore
angularjs interview questions and answers
angularjs Training in marathahalli
angularjs interview questions and answers
angularjs-Training in pune
Nice blog. Can't be written much better. You’re doing a great job. Keep continuing.
ReplyDeleteSpoken English in Bangalore
Spoken English Institutes in Bangalore
Spoken English Coaching Classes near me
English Speaking Classes in Bangalore
Spoken English Coaching in Bangalore
Spoken English Training Institute in Bangalore
Best Spoken English Coaching in Bangalore
Really this blog convinced me to know the next updates of this technology.
ReplyDeleteSelenium Training in Chennai
Selenium Training
iOS Training in Chennai
French Classes in Chennai
Big Data Training in Chennai
Qtp training in Chennai
Qtp training
Thanks for providing wonderful information with us. Thank you so much.
ReplyDeleteAviation Academy in Chennai
Aviation Courses in Chennai
best aviation academy in chennai
aviation training in chennai
Very nice blog, Thank you for providing good information.
ReplyDeleteAirport management courses in chennai
diploma in airport management in chennai
diploma in airport management course in chennai
diploma in airline and airport management in chennai
very good information
ReplyDeletejava training in Marathahalli
spring training in Marathahalli
java training institute in Marathahalli
spring and hibernate training in Marathahalli
Thanks for such a great article here. I was searching for something like this for quite a long time and at last, I’ve found it on your blog. It was definitely interesting for me to read about their market situation nowadays. Well written article Thank You for Sharing with Us pmp training fee | | project management training in chennai | project management certification online | project management course online |
ReplyDeleteIt's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command
ReplyDeletepython training institute in marathahalli
python training institute in btm
Python training course in Chennai
Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.
ReplyDeleteData Science Training in Chennai | Data Science Training institute in Chennai
Data Science course in anna nagar
Data Science course in chennai | Data Science Training institute in Chennai | Best Data Science Training in Chennai
Data science course in Bangalore | Data Science Training institute in Bangalore | Best Data Science Training in Bangalore
Data Science course in marathahalli | Data Science training in Bangalore
Very impressive thanks for posting
ReplyDeleteazure certification training course chennai
The great service in this blog and the nice technology is visible in this blog. I am really very happy for the nice approach is visible in this blog and thank you very much for using the nice technology in this blog
ReplyDeletefire and safety course in chennai
I am a regular reader of your blog and being students it is great to read that your responsibilities have not prevented you from continuing your study and other activities. Love
ReplyDeleteDevOps Training in Bangalore
DevOps Training in Bangalore
DevOps Training in Bangalore
DevOps Training in Marathahalli
DevOps Training in Pune
DevOps Online Training-gangboard
"“I had so much fun learning with you. Your lessons were very insightful and interactive, so thank you. You’re the best Guider ever!”
ReplyDelete"
Authorized ipad service center in Chennai | Authorized apple service center in Chennai | iphone display replacement | Authorized ipad service center in Chennai | Authorized ipod service center in Chennai | Apple laptop service center in chennai | 100% genuine mobile parts | Mobile phone Battery replacement
Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
It would have been the happiest moment for you,I mean if we have been waiting for something to happen and when it happens we forgot all hardwork and wait for getting that happened.
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
uipath online training
Python online training
Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
ReplyDeleteAWS Training in Chennai | Best AWS Training in Chennai | AWS Training Course in Chennai
Data Science Training in Chennai | Best Data Science Training in Chennai | Data Science Course in Chennai
No.1 Python Training in Chennai | Best Python Training in Chennai | Python Course in Chennai
RPA Training in Chennai | Best RPA Training in Chennai
Web Designing Training in Chennai | Best Web Designing Training in Chennai
Great article, valuable and excellent article, lots of great information, thanks for sharing with peoples.
ReplyDeleteData Science in Bangalore
Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
ReplyDeletepython training in bangalore
thanks for sharing this information
ReplyDeleteazure training in chennai
azure training in sholinganallur
best data science training in sholinganallur
best data science training in omr
best devops training in chennai
best devops training institute in omr
best java training in chennai
ReplyDeleteI am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.Data Science Courses
Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.
ReplyDeleteir 4.0 training in malaysia
Thanks for updating this information. Good job.
ReplyDeletet shirt photo printing online india
online card printing india
computer rental
laptop in chennai
llp registration services
public limited company registration
Powerful contents are giving more ideas Regarding Technically...and it's used to enhance my knowledge...Keep doing this help ever
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery
The Post is really very Impressive. every concept should be presented neat and clear.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
After reading this blog i am very happy to gain a new message..Thanks for your good sharing!!!
ReplyDeleteAndroid Training in Chennai | Certification | Mobile App Development Training Online | Android Training in Bangalore | Certification | Mobile App Development Training Online | Android Training in Hyderabad | Certification | Mobile App Development Training Online | Android Training in Coimbatore | Certification | Mobile App Development Training Online | Android Training in Online | Certification | Mobile App Development Training Online
Great thoughts you got there, believe I may possibly try just some of it throughout my daily life.
ReplyDeleteangular js training in chennai
angular js training in annanagar
full stack training in chennai
full stack training in annanagar
php training in chennai
php training in annanagar
photoshop training in chennai
photoshop training in annanagar
Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeletejava training in chennai
java training in velachery
aws training in chennai
aws training in velachery
python training in chennai
python training in velachery
selenium training in chennai
selenium training in velachery
Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
ReplyDeletehardware and networking training in chennai
hardware and networking training in tambaram
xamarin training in chennai
xamarin training in tambaram
ios training in chennai
ios training in tambaram
iot training in chennai
iot training in tambaram
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteweb designing training in chennai
web designing training in omr
digital marketing training in chennai
digital marketing training in omr
rpa training in chennai
rpa training in omr
tally training in chennai
tally training in omr
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area. data science training in Hyderabad
ReplyDeleteThanks for provide great Information and looking beautiful blog, really nice required information & the things. I never imagined and i would request, right more blog and blog post like that for us. Thanks you once again
ReplyDeleteJava Training in Chennai
Java Training in Velachery
Java Training in Tambaram
Java Training in Porur
Java Training in OMR
Java Training in Annanagar
Great post. Thanks for sharing such a useful blog.
ReplyDeleteSpoken english classes in t nagar
Spoken English Classes in Chennai
Great post. Thanks for sharing such a useful blog.
ReplyDeleteSalesforce Training in Velachery
Salesforce Training in Chennai