Coder Baba
2.41K subscribers
1.01K photos
23 videos
722 files
726 links
Everything about programming for beginners.
1 and only official telegram channel of CODERBABA India.

Content:
.NET Developer,
Programming (ASP. NET, VB. NET, C#, SQL Server),
& Projects
follow me https://linktr.ee/coderbaba
*Programming
*Coding
*Note
Download Telegram
create Indian flag using HTML CSS & JS
source code ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
indian flag.rar
1.1 KB
๐Ÿ‡ฎ๐Ÿ‡ณ
JAVA Interview Question Answer:
โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”-

1. Define abstract class?
1. A class that is declared using โ€œabstractโ€ keyword is known as abstract class.
2. Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.
3. if a class has at least one pure virtual function, then the class becomes abstract.
4. an instance of an abstract class cannot be created
5. an abstract class can contain constructors in Java

2. Why does the java be a strongly typed language?
a. Java is a strongly typed programming language because every variable must be declared with a data type.
b. A variable cannot start off life without knowing the range of values it can hold, and once it is declared, the data type of the variable cannot change.
c. A strongly typed language compiler enforces strict rules over the operations, what programmer can do, on data types and also passing parameters and return type to a method.
d. An advantage of strongly typed language is it gives consistency over the results
e. Example: Boolean hasDataType;
For the rest of its life, hasDataType can only ever have a value of true or false.

3. Specify default priority value of a thread in Java.
Default priority of a thread is 5 (NORM_PRIORITY).
The value of MIN_PRIORITY is 1 and the value of MAX_PRIORITY is 10.

4. List out the advantages of exception handling.
1. Separating Error-Handling Code from "Regular" Code- Exceptions provide the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program
2. Propagating Errors Up the Call Stack- is the ability to propagate error reporting up the call stack of methods.
3. Grouping and Differentiating Error Types

5. What is the usage of seek in file?
Seek method sets the file-pointer offset, measured from the beginning of this file, at which the next read or write, occurs.

6. Define socket?
โ€ข A socket is a software object that acts as an end point establishing a bidirectional network communication link between a server-side and a client-side program.

7. What is JDBC driver?
1. A JDBC driver is a software component enabling a Java application to interact with a database
2. The JDBC driver gives out the connection to the database and implements the protocol for transferring the query and result between client and database.

8. What is cookie?
1. is a small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing.
2. Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items added in the shopping cart in an online store) or to record the user's browsing activity (including clicking particular buttons, logging in, or recording which pages were visited in the past).

9. Define interface?
1. Like a class, an interface can have methods and variables, but the methods declared in interface are by default abstract (only method signature, no body).
2. To declare an interface, use interface keyword. It is used to provide total abstraction- all the methods in interface are declared with empty body and are public and all fields are public, static and final by default.

10. Give example for events?
1. Changing the state of an object is known as an event.
2. For example, click on button, dragging mouse etc.
3. The java.awt.event package provides many event classes and Listener interfaces for event handling.
11. What is AWT?
1. Java AWT (Abstract Window Toolkit) is an API to develop GUI or window-based applications in java.
2. Java AWT components are platform-dependent i.e. components are displayed according to the view of operating system. AWT is heavyweight i.e. its components are using the resources of OS.
3. The java.awt package provides classes for AWT api such as TextField, Label, TextArea, RadioButton, CheckBox, Choice, List etc.

12. Mention the purpose of connection interface.
1. A Connection is the session between java application and database.
2. The Connection interface is a factory of Statement, PreparedStatement, and DatabaseMetaData
3. i.e. object of Connection can be used to get the object of Statement and DatabaseMetaData.
4. The Connection interface provide many methods for transaction management like commit(), rollback() etc
Follow www.youtube.com/coderbaba
1.What is meant by session tracking?

Session Tracking is a way to maintain state (data) of a user.

It is also known as session management in servlets.
2.What is the use of Java web servers?

It is a computer where the web content can be stored.

In general web servers can be used to host the web sites but there also

used some other web servers also such as FTP, email, storage, gaming etc.

Examples of Web Servers are: Apache Tomcat and Resin.
3.What are the uses of Servlet?

Servlets execute within the address space of a Web server.
It is not necessary to create a separate process to handle each client request.
Servlets are platform-independent because they are written in Java.
4.How will you communicate between two applets?

java.applet.AppletContext class provides the facility of communication between applets.
We provide the name of the applet through the HTML file.
It provides the getApplet() method that returns the object of Applet.

Syntax:

public Applet getApplet(String name)
{
}
5.What is JDBC? How do you connect to the database?

JDBC is an acronym for Java Database Connectivity.
Itโ€™s an advancement for ODBC ( Open Database Connectivity ).
JDBC is a standard API specification developed in order to move data
from frontend to backend. This API consists of classes and interfaces written in Java.
It basically acts as an interface (not the one we use in Java) or channel
between your Java program and databases i.e it establishes a link between the two so that a programmer could send data from Java code and store it in the database for future use.