Interview Questions and Answers - Order By Newest Q661. What is the difference between public class and class ? Core Java
Ans. Class without any access specifier has the default scope i.e it can be accessed by any class within same package. Class declared public can be accessed from anywhere. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   access specifier   access modifiers   public class   class Try 1 Question(s) Test Q662. Which version control (VC) or software configuration management (SCM) systems work with Merge? Scm
Ans. You can use Tortoise SVN,which has Merge Utility embedded in it. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  svn   configuration management   technologies   technical lead Q663. .Can you uninstall an older version of Merge before installing a newer version or build?
Ans. NA Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  technologies   merge Q664. What things you will look for if you get following exception while making DB call ? table or view does not exist Database
Ans. First will check if the table or view actually exist in the DB If it does , Will make sure to see that the application has rights on the schema that holds the respective Table. Will then make sure that we have prefixed the schema with the table name while accessing it. Will then make sure that its not DB Cache that's causing it as the table DDL might have been created recently. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle   technical lead Q665. What's the benefit for specifying constraints like Not Null , Primary Key explicitly instead of specifying it against the column ? Database
Ans. In case we specify them explicitly we can have control over constraint name as otherwise they will be system generated. It provides an ease in case we plan to drop the constraint in future. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Q666. How can we disable a constraint ? Database
Ans. alter table table_name DISABLE constraint constraint_name; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Q667. Can we have foreign key reference to a non primary key column ? Database
Ans. Yes, but the respective key in the foreign table should be declared Unique. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Asked in 2 Companies Q668. What should be done for auto generating primary key id in a table ? Database
Ans. We need to create a sequence. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Q669. Which constraint cannot be specified as an explicit constraint and should be specified with the column only ? Database
Ans. NOT NULL Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   oracle   database   ddl   constraint   table creation Q670. What are the benefits of transitive depency in Maven ? Maven
Ans. Transitive dependencies allows to avoid specifying the libraries that are required by the project which are specified in other dependent projects - Remote or Local. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  maven   maven repository   dependencies   transitive dependencies   build management Q671. Will this code compile ? public class BuggyBread1{ abstract public void test(); } Core Java
Ans. No. It will give the compilation error saying "The abstract method test in type BuggyBread1 can only be defined by an abstract class". We need to declare the class abstract for it to have any abstract method. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   oops   abstract class   abstract methods   java compilation error Q672. Will this Code compile ? abstract public class BuggyBread1{ abstract public void test(){}; } Core Java
Ans. No. This will give a compilation error saying "Abstract methods do not specify a body". Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   abstract classes   abstract methods   java compilation error   java coding   java code   coding   yes-no Q673. Give an Example for Builder Pattern ? Core Java
Ans. String str = new StringBuilder().append("Buggy").append("Bread").toString(); Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   builder pattern   design pattern   stringbuilder   string Asked in 3 Companies Try 1 Question(s) Test Q674. Is this Polymorphism ?
Map<String, List<String>> inventoryManagerCountMap = new HashMap<String, ArrayList<String>>(); Core Java
Ans. No. This will result in compilation error as Polymorphism cannot be performed on Object types. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   polymorphism  object oriented programming (oops)  oops concepts Q675. How to know the structure of a Table in Oracle ? Database
Ans. DESC Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Q676. How to know the constraints on a Table in Oracle ? Database
Ans. SELECT * FROM user_constraints WHERE table_name = '' Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Q677. How to know the default column value of a Table in Oracle ? Database
Ans. Select DATA_DEFAULT from DBA_TAB_COLUMNS where TABLE_NAME = '' and COLUMN_NAME=''; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracleRarely asked as it was introduced with Java 8. Q678. Difference between DoubleSummaryStatistics , IntSummaryStatistics and LongSummaryStatistics ? Core Java
Ans. They all does the same task i.e to compute statistical information on the stream of data. They differ by the way they store the statistical information as they expect a different data type of the values being used. IntSummaryStatistics and LongSummaryStatistics expect non floating point values and hence stores the statistical information like min,max and sum as non floating values ( int or long ) whereas DoubleSummaryStatistics stores these information as floating value. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java8   java 8   lambda expressions   doublesummarystatistics   intsummarystatistics   longsummarystatistics   summarystatistics Q679. What is ConcurrentLinkedDeque ? Core Java
Ans. It's a Collections concrete class that provides implementation of a Double Ended queue that allows concurrent insertion, removal, and access operations that can be executed safely across multiple threads. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   queue   deque   concurrent collections Q680. What is CopyOnWriteArrayList ?
Ans. Its a type of ArrayList in which all Write operations , i.e add and set are performed by creating a new copy. This array never changes during the lifetime of the iterator, so it never throws ConcurrentModificationException Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   list   arraylist   copyonwritearraylist   ConcurrentModificationException Asked in 1 Companies Q681. What are the advantages and disadvantages of CopyOnWriteArrayList ? Core Java
Ans. This collections class has been implemented in such a manner that it can never throw ConcurrentModificationException. As it performs update and write operations by creating a new copy of ArrayList, It's slower compared to ArrayList. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   list   arraylist   copyonwritearraylist   advantages-disadvantages   ConcurrentModificationException Asked in 4 Companies Expert Q682. Name few Concurrent Collection Classes ?
Ans. ConcurrentHashMap ConcurrentLinkedDeque ConcurrentLinkedQueue ConcurrentMap ConcurrentNavigableMap ConcurrentSkipListMap ConcurrentSkipListSet Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   concurrent collections Q683. Name few Collections Map implementations ?
Ans. AbstractMap ConcurrentHashMap ConcurrentSkipListMap EnumMap HashMap IdentityHashMap LinkedHashMap SystemFlavorMap TreeMap WeakHashMap Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   map Q684. What is ArrayIndexOutOfBoundException ? Core Java
Ans. Exception thrown by the application is we try to access an element using an index which is not within the range of array i.e lower than 0 or greater than the size of the array. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   exceptions   arrayindexoutofboundexception Asked in 1 Companies Q685. how can we generate JavaDoc documentation for our code ? Eclipse
Ans. In Eclipse, Go to File -> Export -> Java -> JavaDoc Select the projects , other properties and output directory for which JavaDoc and Click Finish. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   javadoc   eclipse Q686. What is Criteria in Hibernate ? Hibernate
Ans. Criteria is a simplified API for retrieving entities by composing Criterion objects.
For example - session.createCriteria(Employee.class).add( Restrictions.like("name", "A%") ).list();
will return all employee objects having name starting with A. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  hibernate   hibernate criteria Asked in 7 Companies Basic   Frequent Try 1 Question(s) Test Q687. How do we specify the criteria if it involves mapping between two entities or join between tables ? Hibernate
Ans. The following code returns the list of Employee objects having employee name starting with A and Dept Name ( Department , Employee Mapped ).
session.createCriteria(Employee.class,"emp")
.createAlias("emp.department", "dept",Criteria.INNER_JOIN)
.add( Restrictions.like("name", "A%") )
.add(Restrictions.eq("dept.name","Finance")
.list(); Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  hibernate   hibernate criteria   hibernate table mapping Q688. What is your choice while writing queries within Hibernate - criteria or HQL ? Hibernate
Ans. I prefer using Criteria for Dynamic queries and HQL for static queries. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  hibernate   hibernate criteria   hql Q689. Can we initialize member variables within static block ?
Ans. Static block is like static method that gets executed upon class loading. The way static method allows accessing member variables ( using object references only ), the same static block can also access and initialize member variables. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   static block Q690. Which Software Development methodology is being used in your current Job ? General
Ans. We are using Agile methodology. I attend daily stand up where the development leads takes the status of assigned stories, achievements, any bottlenecks or challenges. We follow iteration of 2 weeks. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sdlc   agile methodology   software system analyst   software developer interview   development lead   project lead interview Asked in 14 Companies   frequent