Interview Questions and Answers for 'Raytheon' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Raytheon' - 2 question(s) found - Order By Rating

 Q1. Write a class / program that takes few numbers from the input and then output the average ?Core Java
Ans. public class Class{
   public static void main(String[] args){
      List<Integer> collector = new ArrayList();

      Scanner scanner = new Scanner(System.in);
      int x = scanner.nextInt();
      while(x != 0){
         collector.add(x);
         x = scanner.nextInt();
      }
      System.out.println(collector.stream().collect(Collectors.averagingInt(p->((Integer)p))));
   }
}

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

   Like         Discuss         Correct / Improve     coding  code  collector  streams  Collectors.average     Asked in 1 Companies


Related Questions

  What is a stream and what are the types of Streams and classes of the Streams?
 Explain System.out.println ?
  What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
  Which class is used to read streams of characters from a file?
  Which class is used to read streams of raw bytes from a file?
 How Spliterator in Java 8 different than iterator ?
 Which is better in terms of performance - Iterator or Spliterator ?
 Difference between System.out.printf and System.out.println ?
 What is the difference between the Reader/Writer java.io hierarchy and the Stream class hierarchy?
 Why is it important to close files and streams ?


Frequently asked in Cognizant (CTS)
  Q2. What is Serialization ? Why do we need it ?Core Java
Ans. Storing the state of an object in a file or other medium is called serialization.

Classes can communicate only if they are built together ( as they need Byte code for communication ). What if we need to enable communication between different applications ( i.e they have been built independently or even they reside at different locations ), We need a mechanism that will transfer the Bean state to a Medium than can be transferred to the receiving application.

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

   Like         Discuss         Correct / Improve     java   oops   serialization     Asked in 18 Companies      basic        frequent

Try 1 Question(s) Test


Related Questions

 Can we declare static variables as transient ?
 Which elements of a class are ignored during serialization ?
  Can we serialize static variables ?
  What one should take care of, while serializing the object?
  What is the use of Transient Keyword ?
 serialization and deserialization of singleton class
  Difference between Serialization and Deserialization ?
  What is an Externalizable interface ?
  Difference between serializable and externalizable interface ?



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: