Interview Questions and Answers - Order By Rating Q601. Is this array declaration correct ? If not , Why ?
String[] strArray = new String[]; Core Java
Ans. No, We haven't specified the size of array to be initialized. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  arrays  array initialization Q602. Have you heard of volatile Table in Teradata ? Teradata
Ans. If you create table with VOLATILE option, the life of the table will be only for the current session.
It will be automatically dropped by Teradata manager once session expires. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  teradata  database  volatile table Q603. What is your daily work schedule ? General
This question was recently asked at 'IBM'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies   frequent Q604. What is the difference between log4j and java logging api. Log4j
Ans. log4j is by apache while java logging api is given by sun. log4j is more powerful,extensible and simple to use than java logging api. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q605. Have you worked with Data Feeds ? General
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Datafeed This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  AWS Migration Basic Q607. Which memory segment holds the byte code ? Core Java
Ans. Code Segment Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Memory Management  Code Memory Segment  Code Segment Memory  Code Segment Q608. Can we call a static method using reference currently pointing to null. Core Java
Ans. yes, we can.
exa: public class Java{
public static void main(String... args) {
JAva j= null;
j.greeting(); // call with null reference
}
public static void greeting() {
System.out.println("Hello World");
}
} // output: Hello World Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  static methods   static Asked in 1 Companies Q609. How to run jar file using command prompt Core Java
This question was recently asked at 'CIGNEX Datamatics'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  jar  running jar using command line  cron entry   setting java app as cron Asked in 1 Companies Q610. Diff between Runtime.getRunTime().gc() and System.gc() Core Java
This question was recently asked at 'CIGNEX Datamatics'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q611. Which jar files need to be included for using Hibernate ? Hibernate
Ans. hibernate-orm
hibernate-validator
hibernate-ogm
hibernate-search
or you can download hibernate core with all dependencies. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  hibernate jar files   hibernate Asked in 1 Companies Q612. What is the use of sql dialect ? Hibernate
Ans. Dialect means "the variant of a language".
Similarly in case of SQL Dialect we specify what dialect of SQL to be generated keeping in mind of underlying database. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql dialect  hibernate   hibernate Asked in 2 Companies Q613. Tell something about Sleep method. Core Java
This question was recently asked at 'IBM'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Thread  sleep  multithreading Asked in 1 Companies Basic Q614. Which Java version supports Interface Default methods ? Core Java
Ans. Java 1.8 or Java 8 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  default methods   interface default methods   java 8  java 8 features Q615. Write a program to insert a value after a specific value in an array. Data Structure
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q616. Can we make array volatile in Java ? Core Java
Ans. Yes, you can make an array (both primitive and reference type array e.g. an int array and String array) volatile in Java but only changes to reference pointing to an array will be visible to all threads, not the whole array Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  arrays  volatile Q617. Can we declare an array without assigning the size of an array? Core Java
Ans. No, It will throw compile time error saying "must provide either dimension expressions or an array initializer"
Alternatively we can provide array initializer like
String[] strArray = new String[]{"Buggy","Bread"};
which will initialize it to size 2 with values as "Buggy" and "Bread"
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  arrays  array initialization Q618. Find the length of the non repeated numbers in an array. Data Structure
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q620. Given a max-heap represented as an array, Return the n th largest element without modifying the heap. Algorithm
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q621. In an array every element is repeated twice except one, Find that element? Data Structure
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q622. What is the ideal situation / case for using heap sort ? Algorithm
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  arrays vs linkedlist Q624. Difference between Arrays and ArrayList ? Core Java
Ans. Both Arrays and ArrayLists are used to store elements. Elements can be either primitives or objects in case of Arrays, but only objects can be stored in Arraylist. Array is a fixed length data structure while arraylist is variable length collection class. Once created, you cannot change the size of the arrays, but arraylists can dynamically resize itself when needed.Another notable difference between Arrays and Arrayslist is that arary is part of core java programming and array list is part of collection classes Sample Code for arrays
arraylist Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  array  arraylist  array vs arraylist Asked in 7 Companies basic   frequent Q625. Can you write code to copy one array into another ? Data Structure
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Ans. It's an exception that is thrown when we attempt to add value of an incompatible type to an array.
For example -
Object[] strArray = new String[2];
strArray[0] = 5;
In this code, strArray reference of type Object has currently been assigned the String array but at line 2 we are trying to add an integer value. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  arrays   ArrayStoreException Q627. What is the difference between ArrayIndexOutOfBoundException and ArrayStoreException? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  exception handling Q628. Does Java generate .class file for interfaces ? Core Java
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  .class file  java byte code  interfaces Q629. Can we declare an Interface with abstract keyword ? Core Java
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  abstract keyword Q630. Can we declare constructor inside an interface ? Why ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  interface   constructor