0% found this document useful (0 votes)
33 views4 pages

QP WEBT

The document contains 18 questions related to computer science topics like Java, databases, and web development. For each question there is a multi-sentence answer providing details and explanations. The questions cover a range of technical concepts from Java fundamentals to SQL and frontend technologies.

Uploaded by

divyansh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views4 pages

QP WEBT

The document contains 18 questions related to computer science topics like Java, databases, and web development. For each question there is a multi-sentence answer providing details and explanations. The questions cover a range of technical concepts from Java fundamentals to SQL and frontend technologies.

Uploaded by

divyansh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

AJAY KUMAR GARG ENGINEERING COLLEGE, GHAZIABAD

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTIONS FOR PLACEMENT

Program: B.Tech. Semester: VI


Subject: Web Technology Subject Code: KCS-602

Q1. Role of JRE, JVM and JDK in today’s market.


Ans: JRE: Java Runtime Environment is a software layer that runs on top of a computer’s operating system
software and provides the class libraries and other resources that a specific Java program requires to
run.
JVM: Java Virtual Machine runs live Java applications.
JDK: Java Development Kit is a set of tools for developing Java applications. Every JDK always
includes a compatible JRE because running a Java program is part of the process of developing a Java
program.

Q2. Discuss the effectiveness of constructor in software development in real time projects?
Ans: A constructor is a method that has the same name as that of the class to which it belongs. As soon as a
new object is created, a constructor corresponding to the class gets invoked. Although the user can
explicitly create a constructor, it is created on its own as soon as a class is created. This is known as
the default constructor. Constructors can be overloaded. If an explicitly-created constructor has a
parameter, then it is necessary to create another constructor without a parameter.

Q3. How local variable overwrite instance variables that may affects bugs in software, justify your
answer?
Ans: Variables that are only accessible to the method or code block in which they are declared are known as
local variables. Instance variables, on the other hand, are accessible to all methods in a class. Local
variables are used within functions or methods to temporarily store values during the operation of the
program. When values are assigned to local variables, it has no impact on an instance variable which is
shared among all methods of a particular class. Therefore, assigning values to local variables will not
affect other parts of the code. This is because local variables are only available within the block they
were created and cannot be accessed outside of it. Thus, assigning local variables has no impact on the
code and does not lead to bugs in most cases

Q4. Interface is a new technique in java, students justify the need of this technique in real time
project?
Ans: A Java interface is a template that has only method declarations and not method implementations. It is
a workaround for achieving multiple inheritances in Java. Some worth remembering important points
regarding Java interfaces are:
• A class that implements the interface must provide an implementation for all methods
declared in the interface.
• All methods in an interface are internally public abstract void.
• All variables in an interface are internally public static final.
• Classes do not extend but implement interfaces.

Q5. Abstraction in any project is important, how you can think development of software project
without an abstraction, is it possible or not, clearly mention your answer.
Ans: The development of software projects without abstraction is not possible. Abstraction allows for
efficient and effective communication of ideas, organizing code into meaningful units, and separating
implementation details from the overall design of a software system.
Q6. Do you think a method can be abstract also, if your answer is yes, elaborate your answer?
Ans: Yes, an abstract method can be abstracted, meaning it can be further refined or implemented in a more
specific or customized way. This can improve the flexibility and modularity of the code, as well as
making it more reusable and efficient. A method in Java that only has the declaration and not
implementation is known as an abstract method.

Q7. Multiple inheritance always creates a bug in real project, still if it is needed in Software
development project, then how you will implement in java.
Ans: While multiple inheritance can be useful in certain software development projects, it can introduce
complexity and potential bugs if not used carefully. Java does not directly support multiple inheritance,
but it can be achieved through interfaces. In Java, a class can implement multiple interfaces but can
only extend one class.

Q8. We feel our computer must do multiple tasks at a time but we have one CPU, so how you will
perform multiple tasks/threads in java.
Ans: Multithreading in Java refers to the process of running multiple threads simultaneously within a single
program to perform multiple tasks. This can be achieved by creating multiple threads and dividing the
work among them. To create a new thread in Java, a separate class that extends the Thread class must
be defined, and the run() method of this class must be used to define the operation to be performed in
the new thread. Another way of making a thread in Java is by implementing a runnable interface.
For doing so, there is the need to provide the implementation for the run() method.

Q9. What happens if an exception is raised in the program and that exception is not handled? Which
keyword of Java will be used?
Ans: The Java throws keyword is used to declare an exception. It gives an information to the programmer
that there may occur an exception. So, it is better for the programmer to provide the exception
handling code so that the normal flow of the program can be maintained.

Q10. How to handle abnormal termination of running software, discuss the approach to handle this
situation. Also mention the keywords of java language.
Ans: There are two crucial exception handling keywords in Java, followed by the third keyword final, which
may or may not be used after handling exceptions.
try: If and when a code segment has chances of having an abnormality or an error, it is placed within
a try block. When the exception is raised, it is handled and caught by the catch block. The try
block must have a catch() or a final() or both blocks after it.
Catch: When an exception is raised in the try block, it is handled in the catch block.

Q11. Other programming languages have capabilities to access memory directly, but java stop this
capability, give reason why & how it is implemented.
Ans: Java is designed to provide a high level of abstraction for programmers, which means that java handles
many low-level details, including memory management. Java's garbage collector is responsible for
keeping track of memory usage and freeing up space that is no longer in use. This prevents manual
memory management, which can be prone to errors and leaks, as well as other low-level issues that
could arise. JVM is responsible for implicit memory allocation; thus, Java does not support pointer due
to security reason.
Q12. How will you access current object in Java?
Ans: Using ‘this’ keyword, we can refer the current object and its variables. For example:
class Student {
int rollno;
String name;
float fee;
Student(int rollno,String name,float fee){
this.rollno=rollno;
this.name=name;
this.fee=fee;
}
}

Q13. Name the class/interface in JDBC which is used to store result from the query.
Ans: The java.sql.ResultSet interface object stores the result set of a SQL query. Initially, object is pointing
before the first row. Use next() to Moves the cursor to the next row.

Q14. Tell the name of class/interface which is used in java to execute the database query.
Ans: The technique used in Java to connect to a database is called JDBC (Java Database Connectivity).
JDBC has Statement interface that is used to query the database. Functions to post queries methods to
database are :
execute(): it can be used for any kind of SQL Query.
executeQuery() : it can be used for select query.
executeUpdate(): it can be used to change/update table.

Q15. There are various databases in the market and all want to connect to java programming
language, then how do you permit them in your programming to access the database, tell the
name of class.
Ans: The DriverManager class acts as an interface between users and drivers. It keeps track of the drivers
that are available and handles establishing a connection between a database and the appropriate driver.

Q16. How many packages are available in JDBC API?


Ans: Two types of packages are available in JDBC API
java.sql
javax.sql

Q17. When we access a website, some processing is going on, that may delay the results to display at
webpage, tell the name of language that ensures processing of the input at client site to improve
performance.
Ans: JavaScript is the language that can ensure processing of the input given by the user. It is a text-based
programming language used for both client-side and server-side that allows you to make web pages
interactive. When you enter data into a form on a website, JavaScript is used to process that data and
send it to the server. JavaScript can also be used to validate the data that you enter, making sure that it
is in the correct format.

Q18. Explain how to make html more presentable and eye catching for attracting more visitors.
Ans: Cascading Style Sheets (CSS) is a style sheet language used for specifying the presentation and styling
of a document written in a markup language such as HTML. There are three types of CSS: external,
internal, and inline.
Q19. If you want to insert java program in html, then specify which server language is suitable.
Ans: JSP stands for Java Server Pages, which is a server-side technology used to develop dynamic web
applications. JSP files contain embedded Java code within HTML, allowing developers to dynamically
output content to the browser. Tags of JSP are:
<%@ page language="java" %> <%-- Directive Tag --%>
<%! int count = 0; %> <%-- Declaration Tag --%>
<% count++; %> <%-- Scriptlet Tag --%>
<%= count %> <%-- Expression Tag --%>

Q20. Specify the programming technique in java that can manipulate data receive from client and can
send the result in presentable format using html.
Ans: A servlet is a Java programming language class that is used to extend the capabilities of servers that
host applications accessed by means of a request-response programming model. Although servlets can
respond to any type of request, they are commonly used to extend the applications hosted by web
servers. Execution of Servlets basically involves Six basic steps:
The Clients send the request to the Web Server.
• Web Server receives the request.
• Web Server passes the request to the corresponding servlet.
• Servlet processes the request and generates the response in the form of output.
• Servlet sends the response back to the webserver.
• Web Server sends the response back to the client and the client browser displays it on the
screen.

****

You might also like