Java - Interview Questions and Answers for 'Atos' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Atos' - 36 question(s) found - Order By Newest

Frequently asked in Infosys and HCL Technologies ( Based on 2 feedback )
 Q1. What are different ways of object creation in Java ?Core Java
Admin
info@buggybread.com
Ans. Using new operator - new xyzClass()

Using factory methods - xyzFactory.getInstance( )

Using newInstance( ) method - (Class.forName(xyzClass))emp.newInstance( )

By cloning an already available object - (xyzClass)obj1.clone( )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   oops   object creation   new operator   class.forname   cloning   ebay     Intelligrape  Infosys  Polaris  British Telecom (BT)  Vyom Labs  Deutsche Bank  HCL Technologies      expert


Very Frequently asked. Have been asked in HCL Technologies very frequently ( based on 2 feedback ). Among first few questions in many interviews.
  Q2. Differences between abstract class and interface ?Core Java
Admin
info@buggybread.com
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   classes   abstract class   interfaces     GlobalLogic  HCL Technologies  Tata Consultancy (TCS)  Infosys  Wipro  Mindtree  CapitalOne  Accenture  IBM India  Infoview Technologies  Salesforce  AT&T  United Health Group (UHG)  Verilogue  Amazon  Expeditors  Syntel  SalesForce  Cornerstone OnDemand  Expedia  OLA  NSF International  Copper Mobile  Think Future Technologies  MorphoTrust  Global Healthcare  Prodigious  Internet Brands  SciQuest  arvato Systems  iCIMS  Ideas2IT  virtusa polaris  Vitech Systems  Cognizant (CTS)      basic        frequent


 Q3. What is the difference between the following two code lines ?

1. new OuterClass().new InnerClass();

2. new OuterClass.InnerClass();
Core Java2016-06-30 14:45:37

Ans. In first case we are trying to initialize Inner class object using the instance of Outer Class whereas in second case we are trying to initialize the Inner class object directly using the Outer class name.

In second case , Inner class is "static inner class" as we cannot access "non static inner class" using Classname alone.

In first case, the inner class could be either "static inner class" or "non static inner class".

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     inner classes  inner class   static inner class   new operator


Very Frequently asked across all type of companies and across all levels.
  Q4. Difference between Public, Private, Default and Protected ?Core Java
Anonymous
Ans. Private - Not accessible outside object scope.

Public - Accessible from anywhere.

Default - Accessible from anywhere within same package.

Protected - Accessible from object and the sub class objects.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   oop   access specifier   public   private   default   protected   basic interview question     HCL Technologies  Tata Consultancy (TCS)  IBM  Wipro  Deegit  Argonne National Laboratory  Motorola Mobility  Accenture  Deegit  Cerner      basic        frequent

Try 1 Question(s) Test


 Q5. According to Java Operator precedence, which operator is considered to be with highest precedence?Core Java
Admin
info@buggybread.com
Ans. Postfix operators i.e () [] . is at the highest precedence.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   operators   operator precedence     Palpap Ichinichi  Veritas


 Q6. Difference between new operator and Class.forName().newInstance() ?
Admin
info@buggybread.com
Ans. new operator is used to statically create an instance of object. newInstance() is used to create an object dynamically ( like if the class name needs to be picked from configuration file ). If you know what class needs to be initialized , new is the optimized way of instantiating Class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   oops   object instantiation   object creation   class.forname   newinstance   new operator   difference between   advanced      intermediate


 Q7. What is comparator interface used for ?Core Java
Admin
info@buggybread.com
Ans. The purpose of comparator interface is to compare objects of the same class to identify the sorting order. Sorted Collection Classes ( TreeSet, TreeMap ) have been designed such to look for this method to identify the sorting order, that is why class need to implement Comparator interface to qualify its objects to be part of Sorted Collections.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   collections   treemap   treeset   comparator     ZapCom  Verilogue      Intermediate

Try 2 Question(s) Test


Usually asked in relation to casting and ClassCastException.
 Q8. What is instanceOf operator ? Explain it's use ?Core Java2017-06-12 07:58:22

Ans. The operator instanceOf is used to verify if the specified object is the instance of specified class or interface.

Syntax if(x instanceOf ABC)

where x is an object reference and ABC could be a class name or interface name. The above statement will be true if x holds an object that is an instance of ABC or any of the child class of ABC or if x holds an object that implements ABC.

instanceOf operator is used to verify in case of downcasting. For ex -

DerivedClass extends BaseClass

x is the reference of BaseClass but holds DerivedClass object ( Polymorphism )

There is an operation that is defined in Derived Class, let's say derivedClassMethod()

We cannot call derivedClassMethod() directly using x as x is reference of BaseClass and not DerivedClass and hence can only access methods that are defined in BaseClass and overridden in derived class.

Though we can cast it to DerivedClass as following
((DerivedClass)x).derivedClassMethod();

But it may throw ClassCastException in case x doesn't hold an instance of DerivedClass at that point.

So before casting it to DerivedClass we may like to make sure that it is an instance of DerivedClass and hence won't throw ClassCastException.

So we make a check for it

if(x instanceOf DerivedClass) {
((DerivedClass)x).derivedClassMethod();
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     instanceOf  instanceOf operator  Why we need instanceOf operator  use of instanceOf operator     Trimax IT Infrastructure & Services   ultramain      Intermediate        frequent


Frequently asked.
  Q9. What is an Iterator?Core Java
Anonymous
Ans. Iterator is an interface that provides methods to iterate over any Collection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   collections   iterator     Magic Software  Maverick Software  Wipro  IBM  HCL Technologies  Tata Consultancy (TCS)  Cognizant (CTS)  Wipro  Accenture      basic        frequent



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



Frequently asked in CTS ( Based on 2 feedback )
  Q10. What is the difference between comparable and comparator in java.util pkg?Core Java
Admin
info@buggybread.com
Ans. Comparable interface is used for single sequence sorting i.e.sorting the objects based on single data member where as comparator interface is used to sort the object based on multiple data members.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   java.util   comparable   comparator   collections     Verilogue  Accenture  Varian Medical Systems  L&T Infotech  Oracle  eIntern  Happiest Minds Technologies  HCL Technologies  Cognizant (CTS)  Cerner  Coviam  EdgeVerve Systems  Virtusa Polaris  Trimax IT Infrastructure & Services      basic        frequent


 Q11. Difference between Class#getInstance() and new operator ?
Admin
info@buggybread.com
Ans. Class.getInstance doesn't call the constructor whereas if we create an object using new operator , we need to have a matching constructor or copiler should provide a default constructor.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   constructor   object creation   default constructor   getinstance   new operator


 Q12. What is the difference between >> and >>>?
Admin
info@buggybread.com
Ans. Both bitwise right shift operator ( >> ) and bitwise zero fill right shift operator ( >>> ) are used to shift the bits towards right. The difference is that >> will protect the sign bit whereas the >>> operator will not protect the sign bit. It always fills 0 in the sign bit.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   operators   bitwise operators   binary shift   right shift


 Q13. Which Java operator is right associative?Core Java
Admin
info@buggybread.com
Ans. The = operator is right associative.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   operators   = operator


 Q14. What are few iterator classes provided by Java ?
Admin
info@buggybread.com
Ans. http://www.buggybread.com/2015/01/java-iterator-classes-and-interfaces.html

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   collections   iterator


 Q15. Difference between prefix and postfix increment operator ?
Admin
info@buggybread.com
Ans. Prefix operator performs the increment and then assignment whereas its inverse for postfix operator.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     prefix increment operator   postfix increment operator   operators   java      basic        frequent


 Q16. What are fail-fast Iterators ?Core Java2016-06-09 09:27:36

Ans. Fail-fast iterators detect illegal concurrent modification during iteration and fail quickly and cleanly rather than risking arbitrary, non deterministic behavior at an undetermined time in future. Example could be of an Iterator failing if it smells ConcurrentModificationException.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     fail-fast Iterators  Iterators     Roposo  Elitecore Technologies  Google  InfoTrellis  Infosys      intermediate


 Q17. Write code to check if an integer is odd or even using ternary operator

Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=963

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     ternary operator  code  coding


 Q18. Is Iterator a class ?

Ans. No, iterator is an interface that is used to parse through the elements of a Collection

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     collections  iterator


Rarely asked as it was introduced with Java 8.
 Q19. What is the use of :: operator wef from Java 8 ?Core Java2016-07-25 13:27:57

Ans. We can refer to a function using this operator like System.out.println(intList.stream().reduce(Math::max).get());

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     :: operator   lambda expression  java 8



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. What is the difference between = and == in Java ?Core Java2016-09-02 08:12:45

Ans. = is the assignment operator that assigns the result of the expression on the right to the variable on the left, whereas

== is the operator to check object equality to see if the reference on left and right are pointing to the same object. For primitive types, its used to check if both variables holds the same value.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     =  ==  assignment operator  object equality  difference between      Basic


 Q21. How Spliterator in Java 8 different than iterator ?Core Java2016-11-24 09:44:49

Ans. Though there are many differences the way internally they both iterates the collections and streams respectively, but the main difference in performance that is achieved by spliterator as it can iterate Streams in Parallel whereas iterator only iterates collections sequentially.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java8  java 8  spliterator  java 8 streams  streams


 Q22. Which is better in terms of performance - Iterator or Spliterator ?Core Java2016-11-24 09:46:26

Ans. Spliterator has better performance potential than iterators but only if the potential is used. Spliterator can iterate streams in parallel as well as in sequence whereas iterator can only iterate in sequence.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     iterator  collections  streams  parallel streams  Spliterator


Frequently asked Generic Question.
  Q23. Why do you want to work for our company ?General2016-11-30 21:01:09

Ans. [Open Ended Answer]

Usually answered stating your keen interest in the role offered and challenges and opportunities the role offers.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          Netflix  FINRA  Goldstone technologies  The Bank of New York Mellon (BNY Mellon)  McDonalds  GNC  GHX  Macys  Ikea  TireBuyer.com  NTT Data  Target  LiquidNet  USAA VetFIT  Tango  DailyMotion  SRA International  Operative Media  Promethean World  ZipRealty  DataXu  Major League Baseball  Pearson  Industrial Scientific Corp  GrubHub  Dealer.com  SAIC  Lixar IT  Equifax  Novell  Volkswagen  Rakuten  Atos  Paytym  Expeditors   Uline  CNBC  Perficient  AppWay  ZipRealty  Flagstar Bank  Tessella        frequent


 Q24. Which operators in Java have highest precedence ?Core Java2017-01-07 17:00:43

Ans. Braces, i.e () and [] have the highest precedence

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java operators


 Q25. What are the cursors available in Java ?Core Java2017-01-15 14:55:22

Ans. Enumeration
Iterator
List iterator

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     cursors  iterator


 Q26. Explain dot(.) operator ?Core Java2017-01-19 13:53:35

Ans. Its used to access the object properties using the object reference or class properties using the Class Name. Moreover its used to access the classes and Interfaces of a package.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     operators


 Q27. What are the different operators in Java ?Core Java2017-01-28 15:15:36

Ans. && - AND
|| - OR
! - LOGICAL NOT

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     operators      Basic


 Q28. What is the difference between && and & in Java ?Core Java2017-02-03 08:30:47

 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     operators  logical vs bitwise operator


 Q29. What is the precedence of operators in Java ?Core Java2017-03-01 09:42:52

Ans. http://introcs.cs.princeton.edu/java/11precedence/

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     operators  operator precedence      basic



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q30. What is a mutator in Java?Core Java2017-03-10 09:45:05

Ans. Mutator is another name for setter methods, i.e the method allows for mutating the property of an object and eventually the state of the object.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     setter method  mutator


 Q31. What is the difference between Enumeration and Iterator ?Core Java2017-05-07 15:22:08

Ans. Enumeration can iterate only legacy collections like Vector , HashTable and Stack whereas Iterator can iterate both legacy and non legacy collections.

Enumeration is less safer than Iterator

Enumeration is fail safe whereas Iterator is fail fast

Iterator allows for removal of element while traversal whereas Enumeration doesn't have remove method.

Enumerations were introduced in Java 1 whereas Iterators were introduced with Java 2

Enumerations have methods like hasMoreElements and nextElement whereas Iterators have methods like hasNext, next and remove

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     enumeration vs iterator  collections      Basic        frequent


 Q32. Which of the following is valid greater than and equal to operator in Java ?

>=
=>
Core Java2017-05-20 16:23:47

Ans. >=

=> will result in error.

=> somewhat looks like lambda operator "->"

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     operators  >= operator  greater than and equal to operator  comparison operators


 Q33. What is a ternary operator ?Database2017-06-18 16:46:34

Ans. Ternary operator , also called conditional operator is used to decide which value to assign to a variable based on a Boolean value evaluation. It is used as

condition ? value1 : value2

For example

int y = (x > 0) ? x:0; // assign x if it's greater than 0, else assign 0

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     operator  ternary operator      Basic


 Q34. Why doesn't java support operator overloading ?Core Java2017-06-23 08:15:18

 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     operator overloading


 Q35. Which of the following is true for == operator ?Core Java
a. For primitives, == checks if the variables on left and right have same data type
b. For primitives, == checks if the variables on left and right have same value
c. For Objects, == checks if the references on left and right have same data type
d. For Objects, == checks if the references on left and right have same value

Ans.b. For primitives, == checks if the variables on left and right have same value

 Q36. Which of the following is equivalent to following logic ?

Not X && Not Y
Core Java
a. x || Y
b. Not(X || Y)
c. Not(X && Y)
d. Not X && Y

Ans.b. Not(X || Y)



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

14 person from are looking for questions for 'Atos'. Connect with them to better prepare for your interview.Click here and post a message

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: