Showing posts with label Java EE. Show all posts
Showing posts with label Java EE. Show all posts

Thursday, July 9, 2026

IT4206 Enterprise Application Development 2023 MCQ Answers | UCSC BIT Complete IT4206 UCSC BIT 2023 paper solutions with simple theory, examples & quick revision. Covers JPA, Servlets, JSP, WebSocket, JSON & more

💼 IT4206 Enterprise Application Development (2023)

UCSC BIT | MCQ Solutions with Simple Theory & Examples

📚 About this guide: Complete solutions for the IT4206 Enterprise Application Development 2023 paper. Covers JPA, Multi-tier Architecture, Servlets, JSP, WebSocket, and JSON. Each MCQ includes simple theory, a real-world example, and a quick memory trick — perfect for BIT exam revision.
Q1✅ (c) JPA

Java Persistence API (JPA)

Theory: JPA helps Java programs communicate with relational databases (MySQL, Oracle) using Java objects instead of raw SQL.

Example: entityManager.find(Student.class, 1); automatically fetches the student.

Memory Trick: JPA = Java ↔ Database

Q2✅ (d) Business Logic Tier

Where do discount calculations go?

Theory: Business rules (like calculating VIP discounts or taxes) belong in the Business Logic Tier.

Example: If customer is VIP → 20% discount. This calculation happens here.

Q3✅ (a) JAR

Distributing Standalone Java Apps

Theory: A JAR (Java Archive) file packages Java programs into one executable file.

Example: Run using java -jar MyApp.jar. Easy to share!

Q4✅ (c) Web Tier

Handling SOAP & REST

Theory: The Web Tier receives requests from browsers/apps and handles HTTP, REST APIs, and SOAP Web Services.

Flow: Mobile App → REST Request → Web Server → Business Logic → Database.

Q5✅ (a) Application Server

Java EE Deployment

Theory: Java EE applications run inside an Application Server (like Tomcat or WildFly), which manages security, sessions, and transactions.

Example: Online Banking runs on a server (Java EE), while a Desktop Calculator runs directly on your PC (Java SE).

Q11✅ (d) Only a,b

WebSocket Imports

Theory: You only need to import packages for annotations actually used in the code. If the code uses @ServerEndpoint and @OnMessage, only those two are required.

Memory Trick: Import only what you use.

Q12✅ (b) a, b, d

WebSocket Communication

Theory: WebSocket creates a lightweight, bi-directional connection. The server can push data anytime without reconnecting.

Example: WhatsApp live chat. Both users can send messages anytime.

Memory Trick: WebSocket = Live Chat

Q13✅ (a) GET

Requesting Information

Theory: The GET method is used to request/read data from a web server.

Example: Opening www.amazon.com sends a GET request to fetch the webpage.

Memory Trick: GET = Get Data

Q14✅ (c) 300

HTTP Redirection

Theory: HTTP status codes in the 300 range indicate redirection (e.g., 301 Moved Permanently).

Memory Trick: 300 = Move Somewhere Else

Q15✅ (a) JSP

Java Inside HTML

Theory: JSP (JavaServer Pages) allows Java code to be written inside HTML to generate dynamic web pages.

Example: Welcome <%= "Nimal" %> outputs "Welcome Nimal".

Memory Trick: JSP = Java Inside HTML

Q16✅ (a) forward()

RequestDispatcher.forward()

Theory: Transfers the same request and response from one servlet to another. The browser URL does NOT change.

Example: LoginServlet forwards to Dashboard.jsp.

Memory Trick: forward() = Go to another page

Q17✅ (c) @Deprecated

Marking Old Methods

Theory: @Deprecated warns developers that a method is outdated and should not be used in new programs.

Memory Trick: Deprecated = Old Method

Q18✅ (c) @SuppressWarnings

Hiding Compiler Warnings

Theory: Tells Java to ignore unnecessary compiler warnings (e.g., @SuppressWarnings("unchecked")).

Memory Trick: Suppress = Hide

Q19✅ (e) a,b,c,d

JSP Elements

Theory: The 4 main JSP elements are:

  • Declaration: <%! int x=10; %> (Variables)
  • Scriptlet: <% out.println("Hi"); %> (Java code)
  • Expression: <%= name %> (Output)
  • Directive: <%@ page ... %> (Instructions)

Memory Trick: DSED

Q20✅ (d) @WebInitParam

Servlet Initialization Parameters

Theory: Defines configuration values for a servlet during initialization instead of hardcoding them.

Memory Trick: Init = Initial Settings

Q21✅ (a) contextDestroyed()

ServletContextListener

Theory: Listens to the web app lifecycle. contextInitialized() runs on start, contextDestroyed() runs when the app stops.

Memory Trick: Destroyed = Application Closed

Q22✅ (b) <% ... %>

Executing Java Code in JSP

Theory: The Scriptlet tag <% ... %> is used to execute Java code on the server.

Memory Trick: Scriptlet = Java Code

Q23✅ (c) "firstName":"Nimal"

Correct JSON Syntax

Theory: JSON stores data as "Key":"Value". It strictly requires double quotes for keys and string values.

Memory Trick: JSON uses DOUBLE QUOTES

Q24✅ (d) invalidate()

Destroying a Session

Theory: When a user logs out, session.invalidate(); destroys their session completely.

Memory Trick: Logout = invalidate()

Q25✅ (b) service()

Handling HTTP Requests

Theory: In the Servlet lifecycle, service() handles every client request and decides whether to call doGet() or doPost().

Memory Trick: service() = Handle Requests

Quick Revision (All 25 Questions)

QAnswerMemory Trick
1JPAJava ↔ Database
2Business TierBusiness Rules
3JARJava Package
4Web TierREST & SOAP
5App ServerJava EE
6a,b,cApache = Server
7Session BeanOne Client
8@PrePassivateBefore Passivation
9PassiveSleeping State
10@ServerEndpointWebSocket
11Only a,bImport Used Packages
12a,b,dLive Communication
13GETRead Data
14300Redirection
15JSPJava in HTML
16forward()Transfer Request
17@DeprecatedOld Method
18@SuppressWarningsHide Warnings
19DSEDJSP Elements
20@WebInitParamInitial Settings
21contextDestroyed()Application Stops
22<% ... %>Scriptlet = Java Code
23"Key":"Value"Double Quotes
24invalidate()Logout
25service()Handles Requests

🎯 Exam Tips

  • JPA → Connects Java applications to relational databases.
  • Business Logic Tier → Contains business rules like discounts and tax calculations.
  • Web Tier → Handles HTTP, REST, and SOAP communication.
  • WebSocket → Enables two-way (bi-directional) communication.
  • Servlet Lifecycle → init() → service() → destroy().
  • Session → invalidate() logs the user out.
  • JSON → Uses "key":"value" format with double quotes.

❓ Frequently Asked Questions (FAQ)

Q: What is the main purpose of JPA in Java EE? A: JPA (Java Persistence API) allows Java applications to connect and interact with relational databases using Java objects instead of writing raw SQL queries.
Q: What is the difference between forward() and include() in Servlets? A: forward() transfers the request to another resource completely (URL doesn't change), while include() adds the content of another resource into the current response.
Q: How do you destroy an HttpSession in Java? A: You can destroy a user's session by calling the session.invalidate() method, which is typically used during user logout.
Q: What are the four main JSP elements? A: The four main JSP elements are Declarations (<%! %>), Scriptlets (<% %>), Expressions (<%= %>), and Directives (<%@ %>).
Q: Why is WebSocket better than HTTP for live chat? A: WebSocket creates a persistent, bi-directional connection, allowing the server to push data instantly without the client needing to reconnect repeatedly like in HTTP.

🎓 Expert ICT, Coding, School Classes, Digital Marketing & University Project Guidance

Struggling with your university final year project? Want to master coding, upscale your business with expert digital marketing, or learn absolute computer basics from scratch? We offer high-quality individual and group online classes conducted in English, Sinhala, or Tamil mediums. Get guaranteed academic success and professional growth with tailored guidance.


🎓 University Final Year Project Guidance & AI

Get specialized, end-to-end mentoring and technical support to pass your degree or master's program with flying colors:

  • 🏫 Targeted Institutes: Expert guidance tailored for BIT UCSC, UoM, SLIIT, NIBM, and other leading universities.
  • 🔬 Postgraduate Support: Comprehensive assistance for MSc Software Final Year Projects.
  • 🤖 AI & Smart Applications: Step-by-step implementation of AI, Machine Learning (ML), and automation modules.
  • Guaranteed Success: Help with documentation, system architecture, coding, and viva preparation.

🏫 School ICT & Corporate Beginner Classes

  • 💻 Non-IT Staff Computer Basics: Absolute beginner-friendly online classes covering essential computer skills, office tools, and internet operations.
  • 🎒 Primary & Secondary (Grades 1-10): Interactive online ICT classes tailored to build strong foundations from early ages.
  • 📝 Exam Prep: Dedicated training packages for GCE O/L, GCE A/L ICT, and GIT exams.
  • 🌍 Global Syllabuses: Complete curriculum coverage for Local, Edexcel, and Cambridge in English & Tamil Mediums.

📢 Software Development & Digital Marketing Services

  • ⚙️ Software & Web Development: Professional custom software application and website development built using PHP & MySQL.
  • 🎯 Social Media Management: Content creation, publishing, and channel management for Facebook, Instagram, TikTok, and YouTube.
  • 📈 Ad Boosting: Highly targeted paid advertising campaigns to drive leads, traffic, and sales to your business.

📞 Connect With Us Instantly

Book your slot for online classes or get a premium tech service quote today!

💬 WhatsApp: +94 729622034

📧 Email: ITClassSL@gmail.com


🌐 Explore Our Resources & Communities

Stay updated with our latest tutorials, project ideas, and student guides across all our official platforms:

Saturday, July 4, 2026

IT4206 Enterprise Application Development MCQ Answers | UCSC BIT 2024 | Java Programming Online Classes

💼 IT4206 Enterprise Application Development

UCSC BIT 2024 | MCQ Solutions with Theory & Examples

📚 About this guide: Complete solutions for the IT4206 Enterprise Application Development paper from UCSC BIT 2024. Covers Java EE, EJB, Servlets, JSP, WebSocket, HTTP protocols, and design patterns. Each MCQ includes theory, a real-world example, and a quick memory tip — perfect for BIT exam revision.
Q1✅ C – Plumbing

What is Plumbing?

Theory: Plumbing is the underlying infrastructure that allows different software components to communicate and exchange data.

Example: When you click Buy on a shopping site, the request travels from UI → Server → Payment → Database. This communication chain is called plumbing.

Q2✅ E – God Class

What is a God Class?

Theory: A God Class is a class that does too many tasks, violating the Single Responsibility Principle (SRP).

StudentManager
- Login()
- Register()
- Delete()
- PrintReport()
- SendEmail()
- CalculateMarks()

Fix: Split into smaller classes like AuthService, ReportService, EmailService.

Q5✅ C – Business Logic Tier

What is Business Logic?

Theory: Contains all business rules and calculations of the application.

If customer is Gold
   Discount = 20%
Else
   Discount = 10%

This calculation belongs to the Business Logic Layer.

Q3✅ A – Server Helper

What is a Server Helper?

Theory: Works inside the Server JVM and helps execute remote requests.

Flow: Client → Server Helper → Server Object → Database

Q4✅ C – DGC

What is Distributed Garbage Collection?

Theory: DGC automatically removes unused remote objects in Java RMI to save memory.

Example: Client disconnects → Remote object no longer used → Java deletes it automatically.

Q6✅ A – Message Driven Bean

What is an MDB?

Theory: Processes messages asynchronously. Clients cannot call its methods directly.

Example: Customer places order → Message sent to queue → MDB processes it later.

Q7✅ B – Java EE Server

Java EE Transaction Management

Theory: Java EE servers provide automatic transaction management (also supports manual control).

Example: Bank transfer: Deduct + Add money. If one fails → entire transaction rolls back.

Q9✅ A – Entity Bean

What is an Entity Bean?

Theory: Represents permanent data stored in databases.

Examples: Student table, Employee table, Product table. Each record = one entity.

Q10✅ B – lookup()

What does JNDI lookup() do?

Theory: Searches the naming service and returns the requested object.

DataSource ds = (DataSource) ctx.lookup("jdbc/MyDB");
Q14✅ A – @JoinColumn

What is @JoinColumn?

Theory: Defines the foreign key between two database tables.

Student (student_id)
   ↓ foreign key
Course (student_id)
Q8✅ E – CREATE

Which is NOT an HTTP method?

Theory: Standard HTTP methods: GET, POST, PUT, DELETE, OPTIONS. There is no CREATE method.

Note: POST is used to create new resources (e.g., new user).

Q16✅ B – POST

What does POST do?

Theory: Sends data to the server to create or update resources.

Examples: User Registration, Login Form, Online Order.

Q17✅ C – HTTP 3xx

What do 3xx status codes mean?

Theory: 3xx codes mean the requested page has been redirected.

  • 301 → Permanent Redirect
  • 302 → Temporary Redirect
Q15✅ D – service()

What does service() do?

Theory: Checks if request is GET or POST and calls the correct method.

GET → doGet() | POST → doPost()

Q18✅ E – web.xml

What is web.xml?

Theory: The deployment descriptor for Java web applications. Maps Servlets to URL patterns.

Q19✅ D – servlet-mapping

What does <servlet-mapping> do?

Theory: Connects a Servlet with a URL.

/login → LoginServlet
Q20✅ D – ServletRequest

What is ServletRequest?

Theory: Contains all data sent by the client.

request.getParameter("username");
Q23✅ B – Web Container

What is a Web Container?

Theory: Manages Servlets, JSPs, sessions, and HTTP requests.

Example: Apache Tomcat's servlet container processes incoming web requests.

Q21✅ A – @OnOpen

What is @OnOpen?

Theory: Executed when a WebSocket connection starts.

Example: User joins a live chat → @OnOpen is called.

Q22✅ E – Control Frames

What are Control Frames?

Theory: Manage the WebSocket connection.

  • Ping – Check connection
  • Pong – Reply to Ping
  • Close – End connection
Q11✅ D – Stateless Session Bean

What is a Stateless Session Bean?

Theory: Does not remember client information between requests.

Example: Currency Converter – each request is independent.

Q12✅ C – NoSuchObjectException

When does NoSuchObjectException occur?

Theory: When a client tries to access a remote object that no longer exists.

Example: Server deletes object → Client calls it again → Exception thrown.

Q13✅ B – init-method

What is init-method?

Theory: Runs immediately after a Spring Bean is created.

Example: Open database connection, load configuration files.

Q24✅ B – Message Driven Bean

MDB Use Case

Theory: Processes messages asynchronously from a queue.

Example: Email notification service processes emails after an order is placed.

Q25✅ A – @PostActivate

What is @PostActivate?

Theory: Called after a Stateful Session Bean is reactivated from passive storage.

Example: User session temporarily stored → later restored → @PostActivate executes.

QAnsMemory Tip
1CPlumbing = Communication infrastructure
2EGod Class = One class does everything
3AServer Helper = Runs inside server JVM
4CDGC = Deletes unused remote objects
5CBusiness Logic = Rules & calculations
6AMDB = Asynchronous messaging
7BJava EE = Automatic transactions
8ECREATE is NOT an HTTP method
9AEntity = Database object
10Blookup() = Find object by name
11DStateless = No client memory
12CObject removed → NoSuchObjectException
13Binit-method = Bean initialization
14A@JoinColumn = Foreign key
15Dservice() calls doGet()/doPost()
16BPOST = Send data
17C3xx = Redirect
18Eweb.xml = Deployment descriptor
19Dservlet-mapping = URL mapping
20DServletRequest = Client request data
21A@OnOpen = Connection starts
22EControl Frames = Ping/Pong/Close
23BWeb Container = Runs Servlets
24BMDB = Queue message processor
25A@PostActivate = Bean reactivated

❓ Frequently Asked Questions (FAQ)

Q: What is IT4206 Enterprise Application Development? A: IT4206 is a UCSC BIT course covering Java EE, EJB, Servlets, JSP, WebSocket, and enterprise design patterns for building scalable web applications.
Q: What is the difference between Stateful and Stateless Session Beans? A: Stateful beans maintain client state between requests, while Stateless beans do not remember client information — each request is independent.
Q: What is a God Class and why is it bad? A: A God Class is a class that handles too many responsibilities, violating the Single Responsibility Principle. It makes code hard to maintain, test, and reuse.
Q: What does the service() method do in a Servlet? A: The service() method checks whether the request is GET or POST and dispatches it to doGet() or doPost() accordingly.
Q: What are HTTP 3xx status codes? A: 3xx codes indicate redirection. 301 means permanent redirect, and 302 means temporary redirect.

🎓 Expert ICT, Coding, School Classes, Digital Marketing & University Project Guidance

Struggling with your university final year project? Want to master coding, upscale your business with expert digital marketing, or learn absolute computer basics from scratch? We offer high-quality individual and group online classes conducted in English, Sinhala, or Tamil mediums. Get guaranteed academic success and professional growth with tailored guidance.


🎓 University Final Year Project Guidance & AI

Get specialized, end-to-end mentoring and technical support to pass your degree or master's program with flying colors:

  • 🏫 Targeted Institutes: Expert guidance tailored for BIT UCSC, UoM, SLIIT, NIBM, and other leading universities.
  • 🔬 Postgraduate Support: Comprehensive assistance for MSc Software Final Year Projects.
  • 🤖 AI & Smart Applications: Step-by-step implementation of AI, Machine Learning (ML), and automation modules.
  • Guaranteed Success: Help with documentation, system architecture, coding, and viva preparation.

🏫 School ICT & Corporate Beginner Classes

  • 💻 Non-IT Staff Computer Basics: Absolute beginner-friendly online classes covering essential computer skills, office tools, and internet operations.
  • 🎒 Primary & Secondary (Grades 1-10): Interactive online ICT classes tailored to build strong foundations from early ages.
  • 📝 Exam Prep: Dedicated training packages for GCE O/L, GCE A/L ICT, and GIT exams.
  • 🌍 Global Syllabuses: Complete curriculum coverage for Local, Edexcel, and Cambridge in English & Tamil Mediums.

📢 Software Development & Digital Marketing Services

  • ⚙️ Software & Web Development: Professional custom software application and website development built using PHP & MySQL.
  • 🎯 Social Media Management: Content creation, publishing, and channel management for Facebook, Instagram, TikTok, and YouTube.
  • 📈 Ad Boosting: Highly targeted paid advertising campaigns to drive leads, traffic, and sales to your business.

📞 Connect With Us Instantly

Book your slot for online classes or get a premium tech service quote today!

💬 WhatsApp: +94 729622034

📧 Email: ITClassSL@gmail.com


🌐 Explore Our Resources & Communities

Stay updated with our latest tutorials, project ideas, and student guides across all our official platforms: