Tag Archives: interview

IS-A Vs HAS-A Relationship in Java

Oracle Java
IS-A (Inheritance) relationship and HAS-A (composition) relationship is the one of the important interview question in core java, design consideration and mostly asked to experience developer to check whether he/she knows basic of design consideration or not. In the object oriented world, re-use is the basic concept and technique either via IS-A (inheritance) or HAS-A ( composition) relationship.

Continue reading IS-A Vs HAS-A Relationship in Java

How to Reverse Array In Java

Oracle Java
Well this my second post to reverse of string. In this post I tried to write how to reverse either string array or int array in java. Although, there are different way do this but I choose in place. you can reverse a string by using library ( prefer library in real life day to day activity in real project). there are different ways: iteration, recursive, in place. This is one of the important interview question which is being asked frequently specially in initial career.
Continue reading How to Reverse Array In Java

How to Convert String to int in Java

Oracle Java
There are various way to convert from string to int in java. It depends where you have to applied this. if any interview will ask then you can ask him/her , library can be used or not. if he/she says yes, then reply by using Integer class to convert but if he wanted to check you logic then you have to chose plain way to convert from string to int. Please ask precondition to Interviewer before replying anything .
Continue reading How to Convert String to int in Java