J2SE Interview Questions & Answers

Showing 10 of 237 questions | Page 23

Technical interview questions and answers are essential for J2SE Interviews because core Java concepts form the foundation of all Java-based development. Companies test your knowledge of OOP principles, exceptions, packages, JVM architecture, threading, collections, and file handling. These topics commonly appear in placement drives and technical interviews conducted by TCS, Infosys, Wipro, Cognizant, and Capgemini. Understanding J2SE concepts helps freshers and job seekers prepare for both Java developer roles and advanced J2EE/Java EE interviews. This guide features the most commonly asked J2SE interview questions with answers explained in simple language. Preparing these questions will strengthen your Java basics and improve your performance in coding tests and technical rounds.

Java programmers should advance their enterprise skills by studying J2EE frameworks and mastering EJB components  for distributed applications 

Showing 10 of 237 questions

221. What is transient ?

A keyword in the Java programming language that indicates that a field is not part of the serialized form of an object. When an object is serialized, the values of its transient fields are not included in the serial representation, while the values of its non-transient fields are included.

222. What is try ?

A Java keyword that defines a block of statements that may throw a Java language exception. If an exception is thrown, an optional catch block can handle specific exceptions thrown within the try block. Also, an optional finally block will be executed regardless of whether an exception is thrown or not.

223. What is type ?

A class or interface.

224. What is Unicode ?

A 16-bit character set defined by ISO 10646. See also ASCII. All source code in the Java programming environment is written in Unicode.

225. What is URI ?

Uniform Resource Identifier. A compact string of characters for identifying an abstract or physical resource. A URI is either a URL or a URN. URLs and URNs are concrete entities that actually exist; A URI is an abstract superclass.

226. What is URL ?

Uniform Resource Locator. A standard for writing a text reference to an arbitrary piece of data in the WWW. A URL looks like "protocol://host/localinfo" where protocol specifies a protocol to use to fetch the object (like HTTP or FTP), host specifies the Internet name of the host on which to find it, and localinfo is a string (often a file name) passed to the protocol handler on the remote host.

227. What is URN ?

Uniform Resource Name. A unique identifier that identifies an entity, but doesn't tell where it is located. A system can use a URN to look up an entity locally before trying to find it on the Web. It also allows the Web location to change, while still allowing the entity to be found.

228. What is variable ?

An item of data named by an identifier. Each variable has a type, such as int or Object, and a scope. See also class variable, instance variable, local variable.

229. What is virtual machine ?

An abstract specification for a computing device that can be implemented in different ways, in software or hardware. You compile to the instruction set of a virtual machine much like you'd compile to the instruction set of a microprocessor. The Java virtual machine consists of a byte code instruction set, a set of registers, a stack, a garbage-collected heap, and an area for storing methods.

230. What is void ?

A Java keyword used in method declarations to specify that the method does not return any value. void can also be used as a nonfunctional statement.
Questions and Answers for Competitive Exams Various Entrance Test