Monday, October 1, 2018

300+ Java Interview Question Answer

JAVA INTERVIEW QUESTION ANSWER FOR FRESHERS AND EXPERIENCE

Java Interview Question
Java Interview Question









Page No:-6

Amazon Best Offer

                                Answer Below the page

 251.Which of the following answer is correct.

String s1 = "yes" ;
String s2 = "yes" ;
String s3 = new String ( s1);

a. s3 == s1  
b. s1 = s2 
c. s1 == s2 
d. s2 = s3 

252. Hashtable is synchronized.

a. yes,
b. No  

253.BigDecimal is a part of which of the following package?

a. java.lang
b. java.io 
c. java.util
d. java.math    

254. Which of the following order Enum followers?

a. Random order
b. Descending order
c. Ascending order
d. None of the above

255. Which of the following method returns the elements of the Enum class?

a. getEnumConstants()   
b. getEnum()  
c. getEnumList()
d. None of the above

256. Which of the following method is used to change the name of a thread?

a. public String getName()
b. public String setName(String name) 
c. public void getName()
d. public void setName(String name)  

257. A thread class belongs to?

a.java.lang  package.   
b.java.io  package.
c.java.util  package.
d.None of Above

258. Which of the following validation can be used in password and security key?

a. Email Validation
b. Url Validation
c. Regex Validation
d. None of the above

259.getConnection() method throws which exception to the DriverManager class?

a. ConnectionNotFoundException
b. DataExecption
c. SQLException   
d. IOException

260. Which of the following code is valid for a database connection?

a. Connection con = DriverManager.openConnection(url);
b. Connection con = new DriverManager.getConnection();
c. Connection con = DriverManager.getConnection();
d. Connection con = DriverManager.getConnection(url, userid, password);  

261. How to create a Frame?

a. By creating the object of Frame class (association)
b. By extending Frame class (inheritance)
c. Both a&b   
d. None of the above

262.Bellow which abstract classes that support reading and writing of byte streams.

a. inputstream, outputstream
b. reader, writer
c. objectreader, objectwriter
d. None of the above

263.Full form of OGNL?

a. Oriented-Graph Navigation Language
b. Object- Graph Navigation Language
c. Object-Goal Navigation Language
d. None of the above

264. A constructor must have no explicit return type.

a. True
b. False

265. RMI Architecture contains how many layers?

a. 2
b. 3
c. 4  
d. 8

266. Can we send mail Using mail API from the servlet?

a. True
b. False

267. HashMap is synchronized.

a. yes
b. No  

268. The ACID properties describe the transaction management.

a. Yes,
b. No   

269.POJO class does not force to implement any interface or extend any class.

a. Yes,
b. No

270. Can we create an object for an interface?

a.Yes
b.No

271. Garbage collection only occurs during the execution of your program.

a. True
b. False

272.StringTokenizer implements the Enumeration interface.

a. True
b. False

273. Method Overloading is possible by changing the return type of the method.

a. True
b. False   

274. An interface is a blueprint of a class.

a. True
b. False

275. The performance of the application will be faster if you use a Prepared Statement interface.

a. True
b. False

276. Abstract Window Toolkit is used for GUI programming in Java.

a. Yes,
b. No

277.LinkedList uses a ___ to store elements internally?

a.  static array.    
b. doubly Linked List 

278. Can we declare constructor inside an interface?

a. Yes,
b. No  

279. Hashtable is synchronized?

a. Yes,
b. No  

280. A switch is more efficient than if - else in java.

a.Yes
b.No

281.IN Java 'JMS' is mainly used to send and receive a message from one application to another.

a. Yes,
b. No

282. The applet works at the client side so Applet takes less response time.

a. True
b. False

283.interface can extend a class?

a. Yes,
b. No  

284. Servlet technology handles multiple simultaneous requests by using threads.

a. Yes,
b. No

285. Thread uses their own Stack?

a.Yes   
b.No

286. The applet works at the client-side and runs inside the browser.

a. Yes,
b. No

287. Which of the XML document comments are given below?

a. < !-- --!>
b. < !-- ?    
c. < /-- --?>
d. < ?-- ? >

288. For every Interface in java, the .class file will be generated after compilation. True or false?

a. Yes,
b. No

289. The PipedInputStream and PipedOutputStream classes can be read and write data simultaneously.

a. Yes,
b. No

290. Can we call String class methods using string literals?

a.Yes
b.No

[  Ans:- 251.c   252.a   253.d   254.c   255.a   256.d   257.a   258.c   259.c   260.d   261.c   262.a   263.b   264.a   265.c   266.a   267.b   268.a   269.a   270.b   271.a   272.a   273.b   274.a   275.a   276.a   277.b   278.b   279.a   280.a   281.a   282.a   283.b   284.a   285.a   286.a   287.b   288.a   289.a   290.a  ]

Amazon Best Offer



LEFTPREHOME
page 1page 2
page 3
page 4page 5page 7

page 8
Disqus Comments