ASoE/Chapter 8/Read MCQs
๐Ÿ“– Back to Study Notes
8

Chapter 8 ยท MCQ Read Mode

Java Programming and Web Technology

ASOE08ยท79 Total MCQs
Question 1 of 79Java basics and multithreading

Which component provides the runtime environment to execute Java bytecode?

AJDK
BJRE
CJVM
DIDE
Answer is hidden
Question 2 of 79Java basics and multithreading

Which of the following includes development tools such as the compiler (javac)?

AJVM only
BJRE only
CJDK
DNone of these
Answer is hidden
Question 3 of 79Java basics and multithreading

Which is the generally preferred way to create a thread in Java, since it avoids single inheritance limitations?

AExtending the Thread class
BImplementing the Runnable interface
CUsing only static methods
DOverriding main()
Answer is hidden
Question 4 of 79Java basics and multithreading

The default thread priority in Java is:

A1 (MINPRIORITY)
B5 (NORMPRIORITY)
C10 (MAXPRIORITY)
D0
Answer is hidden
Question 5 of 79Java basics and multithreading

The 'synchronized' keyword in Java is used to:

ASpeed up thread creation
BAllow only one thread to access a critical section at a time, preventing race conditions
CAutomatically terminate deadlocked threads
DConvert a thread into a process
Answer is hidden
Question 6 of 79Java basics and multithreading

A deadlock occurs when:

AA single thread runs out of memory
BTwo or more threads wait forever for resources held by each other
CA thread finishes execution normally
DThreads have different priorities
Answer is hidden
Question 7 of 79Java basics and multithreading

Which methods, inherited from the Object class, are used for inter-thread communication?

Astart() and run()
Bwait(), notify(), and notifyAll()
Csuspend() and resume()
Dinterrupt() and join() only
Answer is hidden
Question 8 of 79Java basics and multithreading

Why are the Thread class's suspend(), resume(), and stop() methods deprecated?

AThey run too fast
BThey are prone to causing deadlocks
CThey cannot create new threads
DThey are not part of the Java language
Answer is hidden
Question 9 of 79Java basics and multithreading

Which String-related class is thread-safe (synchronized) for mutable character sequences?

AString
BStringBuilder
CStringBuffer
DCharSequence only
Answer is hidden
Question 10 of 79Java basics and multithreading

Which class is used to format and parse dates using a custom pattern, such as 'dd-MM-yyyy'?

ACalendar
BRandom
CSimpleDateFormat
DNumberFormat
Answer is hidden
Question 11 of 79Java swing, AWT, event handling and JDBC

Which method is used to add a component to an AWT Container?

Ainsert()
Badd()
Cplace()
Dattach()
Answer is hidden
Question 12 of 79Java swing, AWT, event handling and JDBC

Which layout manager divides a container into North, South, East, West, and Center regions?

AFlowLayout
BGridLayout
CBorderLayout
DCardLayout
Answer is hidden
Question 13 of 79Java swing, AWT, event handling and JDBC

In the delegation event model, which component generates an event?

AThe listener
BThe event source
CThe Container only
DThe JVM
Answer is hidden
Question 14 of 79Java swing, AWT, event handling and JDBC

Which interface's actionPerformed() method handles button-click events?

AMouseListener
BKeyListener
CActionListener
DWindowListener
Answer is hidden
Question 15 of 79Java swing, AWT, event handling and JDBC

Which class of events represents mouse actions such as clicks and drags?

AActionEvent
BMouseEvent
CKeyEvent
DItemEvent
Answer is hidden
Question 16 of 79Java swing, AWT, event handling and JDBC

Compared to AWT, Swing components are generally:

AHeavyweight and platform-dependent only
BLightweight, with a pluggable look-and-feel
CUnable to handle any events
DWritten in C++ only
Answer is hidden
Question 17 of 79Java swing, AWT, event handling and JDBC

Swing is built on top of which underlying toolkit?

AJava3D
BAWT
CJDBC
DServlet API
Answer is hidden
Question 18 of 79Java swing, AWT, event handling and JDBC

Which design pattern underlies how Swing components separate data, presentation, and interaction logic?

ASingleton
BObserver only
CModel-View-Controller (MVC)
DFactory
Answer is hidden
Question 19 of 79Java swing, AWT, event handling and JDBC

Which of these is a typical Swing container used to hold other components?

AJButton
BJLabel
CJPanel
DJCheckBox
Answer is hidden
Question 20 of 79Java swing, AWT, event handling and JDBC

Swing component class names are conventionally prefixed with which letter?

AS
BW
CJ
DC
Answer is hidden
Question 21 of 79J2EE, servlet programming and JSP programming

Which of the following is a core J2EE technology used for business-logic components?

AHTML
BEJB (Enterprise JavaBeans)
CCSS
DXML only
Answer is hidden
Question 22 of 79J2EE, servlet programming and JSP programming

In a typical multi-tier enterprise architecture, which tier handles servlets and JSPs?

AClient tier
BWeb tier
CBusiness tier
DEIS/Data tier
Answer is hidden
Question 23 of 79J2EE, servlet programming and JSP programming

Compared to GET, a POST request:

AAlways appends parameters to the URL
BSends parameters in the request body, suited to larger/sensitive data
CCannot submit form data
DIs always cached by the browser
Answer is hidden
Question 24 of 79J2EE, servlet programming and JSP programming

Which component manages the lifecycle of servlets and JSPs within an application server?

AThe Web Container
BThe JVM only
CThe Deployment Descriptor
DJDBC
Answer is hidden
Question 25 of 79J2EE, servlet programming and JSP programming

The web.xml file in a Java web application is known as the:

AServlet class
BDeployment Descriptor
CJavaBean
DRequest Dispatcher
Answer is hidden
Question 26 of 79J2EE, servlet programming and JSP programming

Which servlet method is typically overridden to handle an HTTP GET request?

AdoPost()
BdoGet()
Cinit()
Dservice() only
Answer is hidden
Question 27 of 79J2EE, servlet programming and JSP programming

Which mechanism is most commonly used in Java web applications to maintain session state across requests?

AHttpSession
BStatic variables only
CThe Deployment Descriptor
DJavaBeans only
Answer is hidden
Question 28 of 79J2EE, servlet programming and JSP programming

Which RequestDispatcher method transfers control to another resource without the client knowing?

Ainclude()
Bforward()
Credirect()
Ddispatch() (does not exist)
Answer is hidden
Question 29 of 79J2EE, servlet programming and JSP programming

JSP code embedded in HTML is written using which delimiters?

A
B<% %>
C[[ ]]
D## ##
Answer is hidden
Question 30 of 79J2EE, servlet programming and JSP programming

Which JSP tag is used to instantiate or locate a JavaBean for use on the page?

A<jsp:include>
B<jsp:forward>
C<jsp:useBean>
D<jsp:param>
Answer is hidden
Question 31 of 79Introduction to web technology

The basic model underlying the web, where a browser requests and a server responds, is called:

APeer-to-peer architecture
BClient-server architecture
CMesh architecture
DStandalone architecture
Answer is hidden
Question 32 of 79Introduction to web technology

Which HTML5 tag is specifically intended for embedding video content?

A<section>
B<video>
C<nav>
D<article>
Answer is hidden
Question 33 of 79Introduction to web technology

CSS3 media queries are primarily used to enable:

AServer-side scripting
BResponsive design that adapts layouts to different screen sizes
CDatabase connectivity
DXML validation
Answer is hidden
Question 34 of 79Introduction to web technology

Which technology defines the legal structure and elements that a valid XML document must follow?

AXSLT
BDTD
CXHTML
DCSS
Answer is hidden
Question 35 of 79Introduction to web technology

XSLT is primarily used to:

AEncrypt XML data
BTransform an XML document into another format such as HTML
CDefine database schemas
DValidate HTML5 tags
Answer is hidden
Question 36 of 79Introduction to web technology

A digital certificate is issued by a:

AWeb browser
BCertificate Authority (CA)
CDNS server
DSearch engine
Answer is hidden
Question 37 of 79Introduction to web technology

A digital signature primarily provides:

AData compression
BProof of a message's authenticity and integrity
CFaster network speed
DAutomatic translation of languages
Answer is hidden
Question 38 of 79Introduction to web technology

SSL (Secure Socket Layer) is used to:

ASpeed up database queries
BProvide encrypted communication between client and server
CCompile Java servlets
DDesign HTML layouts
Answer is hidden
Question 39 of 79Introduction to web technology

A VPN (Virtual Private Network) primarily provides:

AA public, unencrypted connection
BA secure, encrypted tunnel over a public network
CA new IP addressing scheme only
DA replacement for HTML
Answer is hidden
Question 40 of 79Introduction to web technology

XHTML differs from ordinary HTML mainly because it:

ACannot be displayed in a browser
BIs a stricter, XML-compliant reformulation of HTML
CDoes not support tags at all
DOnly works with PHP
Answer is hidden
Question 41 of 79Client and server-side scripting

JavaScript is best described as a:

AServer-side compiled language
BClient-side scripting language that runs in the browser
CDatabase query language
DMarkup language
Answer is hidden
Question 42 of 79Client and server-side scripting

The DOM (Document Object Model) represents an HTML page as a:

AFlat text file
BTree of objects that scripts can read and modify
CCompiled binary
DDatabase table
Answer is hidden
Question 43 of 79Client and server-side scripting

jQuery's element finder uses selector syntax similar to:

ASQL queries
BCSS selectors
CRegular expressions only
DXML schemas
Answer is hidden
Question 44 of 79Client and server-side scripting

PHP code is typically executed:

AIn the user's browser
BOn the web server, before the page is sent to the client
COnly at compile time
DInside a database engine
Answer is hidden
Question 45 of 79Client and server-side scripting

Which PHP superglobal is used to store data across multiple requests for a session?

A$GET
B$โ‚šโ‚’โ‚›โ‚œ
C$SESSION
D$FILES
Answer is hidden
Question 46 of 79Client and server-side scripting

CRUD operations in a PHP application typically refer to:

ACompile, Run, Update, Delete
BCreate, Read, Update, Delete
CConnect, Retrieve, Undo, Deploy
DCopy, Rename, Upload, Download
Answer is hidden
Question 47 of 79Client and server-side scripting

Magic quotes, a legacy PHP feature, was intended to:

ASpeed up database queries
BAutomatically escape user input to help prevent SQL injection
CCompress uploaded files
DEncrypt session data
Answer is hidden
Question 48 of 79Client and server-side scripting

Which PHP functions are commonly used to work with regular expressions?

Amail() and fopen()
Bpregmatch() and related preg_* functions
Csessionstart()
Darraymerge()
Answer is hidden
Question 49 of 79Client and server-side scripting

A Content Management System (CMS) such as WordPress is commonly built using:

AOnly static HTML
BPHP and a database
COnly client-side JavaScript
DOnly XML
Answer is hidden
Question 50 of 79Client and server-side scripting

Which of these is a jQuery method used for showing/hiding elements with a fade animation?

A.submit()
B.fadeIn()/.fadeOut()
C.pregmatch()
D.connect()
Answer is hidden
Question 51 of 79JDBC

JDBC is used in Java applications primarily to:

ARender HTML pages
BConnect to and interact with relational databases using SQL
CCreate GUI components
DManage threads
Answer is hidden
Question 52 of 79JDBC

Which JDBC driver type converts calls directly into the database's own network protocol and is the most widely used today?

AType 1
BType 2
CType 3
DType 4
Answer is hidden
Question 53 of 79JDBC

Which driver type requires an ODBC driver installed on the client machine?

AType 1 (JDBC-ODBC Bridge)
BType 2 (Native-API)
CType 3 (Network Protocol)
DType 4 (Thin)
Answer is hidden
Question 54 of 79JDBC

Which class manages the list of database drivers and establishes connections?

AResultSet
BDriverManager
CStatement
DSQLException
Answer is hidden
Question 55 of 79JDBC

Which statement type is precompiled and supports parameters, making it faster for repeated execution?

AStatement
BPreparedStatement
CCallableStatement
DNone of these
Answer is hidden
Question 56 of 79JDBC

Which statement type is specifically used to call a stored procedure?

AStatement
BPreparedStatement
CCallableStatement
DResultSet
Answer is hidden
Question 57 of 79JDBC

Which method of a ResultSet moves the cursor to the next row of results?

AgetNext()
Bnext()
Cadvance()
DmoveNext()
Answer is hidden
Question 58 of 79JDBC

Which JDBC object provides metadata about a ResultSet's columns, such as their names and count?

AConnection
BResultSetMetaData
CDriverManager
DSQLException
Answer is hidden
Question 59 of 79JDBC

Which SQL operation corresponds to the 'Read' part of CRUD?

AINSERT
BSELECT
CUPDATE
DDELETE
Answer is hidden
Question 60 of 79JDBC

Which method is used to execute a SQL SELECT query and obtain a ResultSet?

AexecuteUpdate()
BexecuteQuery()
CexecuteInsert()
DgetResult()
Answer is hidden
Question 61 of 79Software Engineering & OOP

Which statement is TRUE about static member functions in C++?

AStatic functions can be overloaded
BStatic functions can access non-static members directly
CStatic functions require an object to be called
DStatic functions cannot have return values
Answer is hidden
Question 62 of 79Software Engineering & OOP

For multiple inheritance in C++, how many base classes are required at minimum?

A1
B2
C3
D4
Answer is hidden
Question 63 of 79Software Engineering & OOP

Which direction flag for the seekg()/seekp() stream functions is NOT valid in C++?

Aios::beg
Bios::cur
Cios::end
Dios::set
Answer is hidden
Question 64 of 79Software Engineering & OOP

When does the Spiral Model of software development terminate?

AAfter the first prototype
BAfter all requirements are met
CAfter a fixed number of iterations
DWhen the product is cancelled or dies
Answer is hidden
Question 65 of 79Software Engineering & OOP

SQA (Software Quality Assurance) combined with SQM (Software Quality Management) forms:

ASoftware Testing
BSoftware Verification
CSoftware Configuration Management
DSoftware Quality Processes
Answer is hidden
Question 66 of 79Software Engineering & OOP

Software is best defined as:

AA set of executable programs only
BA set of programs, associated documentation, and configuration data
CHardware instructions stored in ROM
DAn operating system and its utilities
Answer is hidden
Question 67 of 79Software Engineering & OOP

A Use Case describes interaction between:

AClasses and objects
BModules and components
CActor and the system (product)
DDatabase and application
Answer is hidden
Question 68 of 79Software Engineering & OOP

CASE (Computer-Aided Software Engineering) tools are primarily used for:

AOnly code compilation
BOnly testing
CSupporting all phases of software development and project management
DDatabase administration only
Answer is hidden
Question 69 of 79Software Engineering & OOP

Vertical lines (lifelines) in a UML Sequence Diagram represent:

AMethod calls
BObjects or actors
CTime intervals
DReturn values
Answer is hidden
Question 70 of 79Software Engineering & OOP

In C++ templates, in the declaration template <class T>, T represents:

AA specific class name
BA template type parameter (placeholder for any type)
CA typedef alias
DA global variable
Answer is hidden
Question 71 of 79Software Engineering & OOP

The primary purpose of C++ namespaces is to:

AAvoid naming conflicts and encapsulate code
BSpeed up compilation
CReplace header files
DManage memory allocation
Answer is hidden
Question 72 of 79Software Engineering & OOP

Runtime polymorphism (late binding) in C++ is achieved through:

AFunction overloading
BVirtual functions
COperator overloading
DTemplates
Answer is hidden
Question 73 of 79Software Engineering & OOP

The three main phases of Object-Oriented development are:

AAnalysis, Design, and Implementation
BRequirements, Coding, and Testing
CPlanning, Execution, and Closure
DModelling, Prototyping, and Deployment
Answer is hidden
Question 74 of 79Software Engineering & OOP

Which SDLC model explicitly pairs each development phase with a testing phase in a V-shape?

AWaterfall Model
BV-Model (Verification and Validation)
CSpiral Model
DAgile Model
Answer is hidden
Question 75 of 79Software Engineering & OOP

Version control systems are used primarily to:

ACompile source code
BTrack and manage multiple versions of code and files
CDebug runtime errors
DManage database schemas
Answer is hidden
Question 76 of 79Software Engineering & OOP

The arrow notation in UML represents which relationship?

AAssociation
BAggregation
CGeneralisation (Inheritance)
DDependency
Answer is hidden
Question 77 of 79Software Engineering & OOP

Which C/C++ keyword CANNOT be used as an identifier (variable name)?

Awhile
Bcount
Cvalue
Ddata
Answer is hidden
Question 78 of 79Software Engineering & OOP

The operator used to access a member of a structure through a pointer in C is:

A.
B->
C::
D*
Answer is hidden
Question 79 of 79Software Engineering & OOP

Given classes A, B: public A, C: public B, the type of inheritance demonstrated is:

AMultiple inheritance
BMultilevel inheritance
CHierarchical inheritance
DHybrid inheritance
Answer is hidden
โ† PREVIOUS CHAPTERCh 7: Artificial Intelligence and Neural NetworksNEXT CHAPTER โ†’Ch 9: Real Time Systems, Distributed Systems, Cloud Computing