Anda di halaman 1dari 16

HOW TO CRACK

INTERVIEWS IN JAVA
HOW TO CRACK
INTERVIEWS IN JAVA

Rashmi Kanta Das


Head of Java Research Interface Team
Bhubaneswar

VIKAS® PUBLISHING HOUSE PVT LTD


VIKAS® PUBLISHING HOUSE PVT LTD
E-28, Sector-8, Noida-201301 (UP) India
Phone: +91-120-4078900 x Fax: +91-120-4078999
Registered Office: 576, Masjid Road, Jangpura, New Delhi-110014. India
E-mail: helpline@vikaspublishing.com · Website: www.vikaspublishing.com
x Ahmedabad : 305, Grand Monarch, 100 ft, Shyamal Road, Near Seema Hall,
Ahmedabad-380 051 x Ph. 079-65254204, 98982 94208
x Bengaluru : First Floor, N.S. Bhawan, 4th Cross, 4th Main, Gandhi Nagar,
Bengaluru-560009 x Ph. +91-80-22204639, 22281254
x Chennai : E-12, Nelson Chambers, 115, Nelson Manickam Road, Aminjikarai
Chennai -600029 x Ph. +91-44-23744547, 23746090
x Kolkata : P-51/1, CIT Road, Scheme-52, Kolkata-700014 x Ph. +91-33-22866995 /6
x Mumbai : 67/68, 3rd Floor, Aditya Industrial Estate, Chincholi Bunder, Malad (West),
Mumbai-400064 x Ph. +91-22-28772545, 28768301
x Patna : Flat No. 204, Temple Tower, Sabjibagh, Birla Mandir Road,
Patna-800004 x Ph. 94310 15579
Distributors:
UBS Publishers’ Distributors PVT LTD
5, Ansari Road, New Delhi-110002. India
Phone: +91-11-23273601, 23266646 · Fax: +91-11-23276593, 23274261
E-mail: ubspd@ubspd.com · Website: www.gobookshopping.com
x Ahmedabad: +91-79-22160371 / 2 / 3 x Bengaluru: +91-80-26756672 / 3
x Bhopal: +91-755-4203183 / 93 v Bhubaneswar: +91-674-2314446
x Chennai: +91-44-23746222, 23746351 / 2 x Coimbatore : +91-422-2499917
x Ernakulam: +91-484-2353901, 2373901, 2363905 x Guwahati : +91-361-2461982 / 3 / 4
x Hyderabad : +91-40-24754472 / 3 · Kolkata: +91-33-22529473, 22522910
x Lucknow: +91-522-4025124 / 34 · Mumbai: +91-22-66376922 / 3, 66102069
x Nagpur: +91-712-2736010 / 1 x Patna: +91-612-2672856, 2673973
x Pune: +91-20-24461653, 24433976

How to Crack Interviews in Java


ISBN: 978-93259-6906-3

First Published 2013

Vikas® is the registered trademark of Vikas Publishing House Pvt Ltd


Copyright © Vikas® Publishing House Pvt Ltd., 2013

All rights reserved. No part of this publication which is material protected by this copyright notice may be
reproduced or transmitted or utilized or stored in any form or by any means now known or hereinafter invented,
electronic, digital or mechanical, including photocopying, scanning, recording or by any information storage or
retrieval system, without prior written permission from the publisher.

Information contained in this book has been published by VIKAS® Publishing House Pvt Ltd and has been obtained
by its Authors from sources believed to be reliable and are correct to the best of their knowledge. However, the
Publisher and its Authors shall in no event be liable for any errors, omissions or damages arising out of use of this
information and specifically disclaim any implied warranties or merchantability or fitness for any particular use.
Disputes if any are subject to Delhi Jurisdiction only.

Printed in India.
Dedication

This book is dedicated to my beloved father Late Renu Kant Das


who showed me the right path and inspired me in
every step of my life and career
ACKNOWLEDGEMENTS
First and foremost, I wish to express my heartiest gratitude to my mother Mrs Chhabi Rani
Das, my wife Mrs Usha Kiran Das and my son Sai for standing by my side throughout
my life and my career. They have been a continuous source of inspiration and motivation
which impelled me to put in all my efforts to continue to widen my knowledge and take my
career forward. I am highly obliged to the Director of Interface Software, Mr P K Dixit, for
his support and co-operation. I am thankful to Miss Mousumi Dash, Mr Vivek Panigrahy
and the team members of Core Java Research Team at Interface Software for their die-hard
commitment towards shaping this book, leveraging their perfect blend of knowledge and
skills. I thank Mr Asim Kumar Biswal, Mr Nisith Kumar Nanda, Mr Priyankar Parida,
Ms Swagatika Biswal, Ms Smrutirekha Jena, Ms Kshitiswari Parida and Mr Sisir Kumar
Jena, Head of Marketing, Interface Software for the generous contribution of their insights,
expertise and energy towards this book. I wish to express my gratitude to Mr Sunil Thakur,
Regional Head, East and Mr Suvendu Sinha Roy, Senior Executive, Vikas Publishing
House for the expeditious publication of this book. My special thanks to Ms Sharmila
Chandra, Senior Editor, for her valuable inputs; her efforts are appreciated. Last but not
the least; I owe everything to the one and all, THE ALMIGHTY, the supreme force and the
reason for my existence.
PREFACE
The most powerful tool in today’s world is information. While the Internet has made all
sorts of information easily accessible, what is crucial is the acquisition of knowledge
that is relevant to one’s chosen calling. In this respect, knowledge of Java is crucial for a
successful career in the eld of Information Technology.
The objective of this guide is to familiarize the students with the technology and body
of knowledge about Java from the examination point of view. A perusal of this useful
recapitulation of all key knowledge of Java just before examinations or interview will help
to improve the candidates’ scores considerably. The primary focus of the book is to help
the students learn and judge where they stand. I have tried to cover every aspect of the
subject of Java. Some facets of the technology are only covered to the extent necessary to
help students understand what they need to know, but we hope this book will serve them as
a valuable professional resource in their entire technical career.
This book focuses on providing resources and ideas to help beginners reach a much
higher standard of comprehension by making them familiar with Java programming in
a simple way. It helps students to acquire good programming skills, a strong sense of
problem-solving technique and positive approaches to write a program with the help of
proper description of fundamental ideas, a large number of solved examples, various
interview-related key points and sample questions for practice. This book simplies the
approach towards Java programming in a modular fashion, encapsulating various aspects
in a manner that equips the students with skills to write all kinds of programs.
This book is organized in such a way as to serve as an in-depth review material for
both experienced Java professionals as well as newcomers to Java technologies. Each
chapter covers a major element of examinations with an emphasis on the ‘why’ as well as
the ‘how to’ of working with Java applications.

Rashmi Kanta Das


CONTENTS

Acknowledgements v
Preface vii

Section 1 Fill in the Blanks 1


Answers

Section 2 True or False 6


Answers

Section 3 Multiple Choice Questions 10


Answers

Section 4 Short Questions and Answers 65

Section 5 Basic Programs for Practice 116


Fill in the Blanks 1

Section

Fill in the Blanks

Fill in the Blanks


1. In case of inheritance, child class acquires properties of ____ class.
2. In Java, each class implicitly inherits from ____ class.
3. In Java, ____ code is executed.
4. In Java, memory is managed by ____.
5. ____ classes are introduced for converting data types to String and String to data
types.
6. ____ data type is not implemented on type-casting.
7. Type-casting is ____ type of operator.
8. In Java, ____ and ____ variable must be initialized before use.
9. In Java, ____ variable holds address of the object.
10. ____ variable is treated as class variable.
11. In Java, ____ and ____ modier must be used to declare a constant.
12. ____ keyword is used to call one constructor into another constructor in the same
class.
13. ____ keyword is used to call the base class constructor within the child class
constructor.
14. ____ and ____ keyword is not implemented within static method.
15. ____ is the process that allows a method to call itself.
16. Before the constructor is executed ____ block is executed in Java.
17. ____ block is executed before the main method is executed.
18. Through ____ variable, we extract the size of the array.
19. ____ and ____ methods cannot be overriden.
20. ____ method is dynamically dispatched.
21. abstract method is only declared within ____ class.
22. abstract class is never declared by using ____ keyword.
23. ____ class cannot be inherited.
24. ____ class cannot be instantiated.
25. ____ supports multiple inheritance in Java.
2 How to Crack Interviews in Java

26. Serializable and Cloneable are ____ type of interface.


27. ____ variable never uses nal keyword.
28. ____ variable never uses static keyword.
29. When the variable is ____ and ____ then object cannot be serialized.
30. ____ method is treated as foreign method.
31. In Java, ____ and ____ methods are declared.
32. ____ keyword is used in Java to avoid deadlock.
33. ____ inner class is used to instantiate abstract class and interface.
34. ____ is the base class of Error and Exception.
35. try block executed means ____ block must be executed.
36. ____ provides a standard mechanism to compress and package a set of les for
distribution to the user.
37. ____ is the platform independent le format that aggregates many les into a single
unit.
38. String is ____ and StringBuffer is ____.
39. Through ____ technique, wrapper class object is directly assign to subsequent
primitive data types.
40. Currently executed program is treated as ____.
41. Every thread in Java by default holds ____ priority.
42. ____ method is used to kill a thread.
43. ____ method is used to execute a thread.
44. ____ method of the Object class blocks the thread.
45. ____ class is used to read the data from various input sources.
46. Process class is a ____ class.
47. Vector is a ____ class.
48. ArrayList contains ____ elements.
49. In ArrayList elements are stored in ____ order.
50. ____ cursor is only implemented on legacy classes.
51. ____ cursor extracts the elements in both the directions.
52. ____ and ____interface contain only unique elements.
53. Object of ____ class supports LIFO.
54. ____ class has no main method.
55. Dialog class implicitly supports ____layout.
56. Applet class implicitly supports ____ layout.
57. Frame class implicitly supports ____ layout.
58. ____ layout supports preferred size of the component.
59. Logical address of a program is treated as ____.
60. Socket resides in ____ layer of OSI model.
61. ServerSocket object is only constructed in ____ side application.
62. In RMI ____ class le is the proxy for client side application.
63. ____ package in Java is implicitly imported.
64. In Java, ___ is the base class every Event class.
65. In Java, an interface is inherited from another interface by using ____ keyword.
66. In Java, a class does not support ____ inheritance.
67. By inheriting from ____ interface, we construct user-dened thread.
68. By inheriting from ____ interface, we declare the remote interfaces in Java.
Fill in the Blanks 3
69. ____ method is declared in Java but implemented either in C or C++.
70. ____ API is used for implementing native method.
71. Object of ____ class contains unique elements but in a sorted order.
72. ____ interface contains duplicate elements.
73. ____ is the default value of boolean.
74. ____ is the default value of Object reference.
75. Within a database connection application ____ no. of Connection object is
constructed.
76. ____ interface object is used for IN parameter in java.sql package.
77. If array elements are not initialized, array elements hold ____ value.
78. Static variables are initialized at ____ time.
79. Instance variables are initialized at ____ time.
80. ListIterator is the child interface of ¬¬____ interface.
81. Assign object must implement the ______ interface before it can be written to a
stream as an object.
82. Java standard error stream object belongs to _____class.
83. The process of decoding text back into data is known as _____.
84. One of the simplest and the most popular algorithms for sorting array is referred to
as _____.
85. A _____ is a simple communication channel through which two programs
communicate over a network.
86. _____ is a connection-oriented protocol that provides a reliable ow of data between
two computers.
87. Java’s _____ system allows a thread to enter a synchronized method on an object,
and then wait there until some other thread explicitly noties it to come out.
88. The method that you use to wait for a thread to nish is called _____.
89. When two or more threads need access to a shared resource, they need some way to
ensure that the resource will be used by only one thread at a time. The process by
which this is achieved is called _____.
90. _____ allows two parts of the same program to run concurrently.
91. _____ occurs when two threads have a circular dependency on a pair of synchronized
objects.
92. _____ method must be implemented by all threads to perform all the tasks and
determine the entry point for the thread.
93. _____ is a utility class used to parse or analyse the stream of input.
94. _____ is an abstract class that is used to write to character streams.
95. All Exception types are subclasses of the built-in class _____.
96. An_____ is a Java statement that enables you to assert an assumption about your
program.
97. The _____ traps two different Exception types.
98. An_____ class provides an empty implementation of all the methods in an Event
Listener interface.
99. An_____ is generated when the size, position or visibility of a Component is
changed.
100. To receive an event notication, a listener must register with the _____.
4 How to Crack Interviews in Java

Answer
01. Base 41. NORM_PRIORITY
02. Object 42. stop()
03. byte code 43. start()
04. JVM 44. wait()
05. wrapper class 45. InputStream
06. boolean 46. abstract
07. unary operator 47. legacy
08. Local, nal 48. duplicate
09. reference 49. insertion
10. static 50. Enumeration
11. static, nal 51. ListIterator
12. this 52. Set, SortedSet
13. super 53. stack
14. this, super 54. applet
15. recursion 55. Border
16. non-static block 56. Flow
17. static block 57. Border
18. length 58. Flow
19. static, nal 59. Port number
20. override 60. session
21. abstract 61. Server
22. nal 62. stub
23. nal 63. Java. lang
24. abstract 64. EventObject
25. interface 65. extends
26. marker 66. multiple
27. volatile 67. Runnable
28. transient 68. Remote
29. static, transient 69. native
30. native 70. JNI
31. native, abstract 71. TreeSet
32. synchronized 72. List
33. anonymous 73. false
34. Throwable 74. null
35. nally 75. one
36. JAR 76. PreparedStatement
37. JAR 77. default value of array type
38. immutable, mutable 78. class loading time
39. unboxing 79. Object creation time
40. process 80. Iterator
How To Crack Interviews In Java

20%
OFF

Publisher : SChand Publications ISBN : 9789325969063 Author : Rashmi Kanta Das

Type the URL : http://www.kopykitab.com/product/11714

Get this eBook

Anda mungkin juga menyukai