C 21
C 21
C 21
They are JavaScript is a high-level, interpreted programming language primarily used for front-
fundamental to the object-oriented programming (OOP) paradigm, which emphasizes end web development. It enables interactive web pages by providing dynamic behavior
the organization of code into objects that interact with each other. An object in Java is and interactivity to HTML and CSS content. JavaScript code runs on the client-side
a basic unit of Object-Oriented Programming and represents real-life entities. within web browsers, making it an essential component of modern web development.
Objects are the instances of a class that are created to use the attributes and Here's an overview of JavaScript, its functions, and data types
Function: Manipulating HTML/CSS: JavaScript can manipulate HTML elements,
methods of a class. A typical Java program creates many objects, which as you
attributes, and styles dynamically, enabling the creation of interactive and dynamic web
know, interact by invoking methods. An object consists of :// State: It is represented pages.// Manipulating HTML/CSS: JavaScript can manipulate HTML elements,
by attributes of an object. It also reflects the properties of an object// Behavior: It is attributes, and styles dynamically, enabling the creation of interactive and dynamic web
represented by the methods of an object. It also reflects the response of an object pages.//c lient-Side Validation: JavaScript can perform client-side form validation to
with other objects// Identity: It gives a unique name to an object and enables one ensure that user input meets specified criteria before submitting data to the server.//
object to interact with other objects. DOM Manipulation: JavaScript provides access to the Document Object Model (DOM),
allowing developers to traverse, modify, and manipulate the structure and content of
HTML documents dynamically// Browser APIs: JavaScript provides access to various
browser APIs (Application Programming Interfaces) for tasks such as drawing graphics,
ARRAY In Java, an array is a data structure used to store a fixed-size sequential
handling audio/video, accessing geolocation data, and storing data locally
collection of elements of the same type. It provides a way to store multiple values of the
DATA TYPES: Primitive Data Types:// Number: Represents both integer and floating-
same data type under a single variable name. Arrays can be one-dimensional, multi-
point numbers// String: Represents sequences of characters enclosed within single
dimensional, or jagged arrays (arrays of arrays).// Fixed Size: Once an array is created, quotes ('') or double quotes ("")// Boolean: Represents logical values, either true or
its size cannot be changed. You specify the size of the array when you create it, and that
false// Undefined: Represents the value of variables that have not been assigned a
size remains constant throughout the array's lifetime// Zero-based Indexing: Array
value// Null: Represents the intentional absence of any value// Symbol: Represents
elements are accessed using an index, which starts at 0 for the first element and goes
unique and immutable values used as object properties???? Complex Data Types:
up to (size - 1) for the last element. //Homogeneous Elements: All elements in an
Object: Represents collections of key-value pairs, where keys are strings (or symbols)
array must be of the same data type. You cannot mix different types of elements within
and values can be of any data type, including other objects, functions, and arrays.?????
the same array Declaration and Initialization: Arrays can be declared and initialized
Special Data Type:: Function: Functions are first-class citizens in JavaScript and are
using square brackets [] after the array's type or using the new keyword.// Arrays of treated as objects. They can be assigned to variables, passed as arguments, and returned
Primitive Types and Objects: Arrays can hold elements of primitive types (such as int,
from other functions
char, boolean) or object references. For arrays of objects, each element in the array
holds a reference to an object of the specified type// teration: You can iterate through USES JavaScript is a versatile programming language primarily used for front-end web
the elements of an array using loops like for or foreach./OBJECT ARRAY: In Java, an development, though it's increasingly used in other contexts like back-end development
object array is an array that holds references to objects of a particular class or interface. (with Node.js), mobile app development (with frameworks like React Native), and even
Object arrays are versatile and commonly used to store collections of objects, enabling desktop application development (with frameworks like Electron). Here are some of the
the manipulation and management of data in a structured manner. Here's how object primary uses of JavaScript: Front-End Web Development
arrays work in Java: Dynamic Web Pages: JavaScript enables the creation of dynamic and interactive web
pages by manipulating HTML and CSS in real-time// DOM Manipulation: JavaScript can
JDBC JDBC stands for Java Database Connectivity. It is a Java API (Application Programming modify the Document Object Model (DOM) dynamically, enabling the addition, removal,
Interface) that provides a standard way for Java applications to interact with databases. JDBC and modification of HTML elements and their attributes// AJAX: Asynchronous
enables Java programs to execute SQL statements, retrieve and manipulate data from JavaScript and XML (AJAX) allows web applications to send and receive data from
databases, and manage database connections. servers asynchronously without requiring page reloads//// Single-Page Applications
(SPAs): Frameworks and Libraries: JavaScript frameworks and libraries like Angular,
GOALS: Standardization: JDBC aims to provide a standardized interface for Java
React, and Vue.js facilitate the development of single-page applications (SPAs), which
applications to access databases, regardless of the specific database management
provide a more fluid and responsive user experience by dynamically updating content
system (DBMS) being used. This standardization promotes interoperability and allows
without full page reloads./// Back-End Development (Node.js): Server-Side
developers to write portable database code that can work with different databases
Development: JavaScript can be used for server-side development using Node.js, a
without significant modifications.// Simplicity and Ease of Use: JDBC strives to offer a
runtime environment that allows JavaScript code to run on the server. Node.js enables
simple and intuitive API that Java developers can easily understand and use. By
building scalable, high-performance server-side applications/// Automation and
providing straightforward methods for establishing database connections, executing
Scripting: Node.js Scripts: JavaScript scripts can be used for automating repetitive
SQL queries, and processing query results, JDBC simplifies the process of database
tasks, batch processing, and server-side scripting using Node.js.
interaction for Java applications// Performance and Efficiency: JDBC is designed to be
efficient and performant, minimizing overhead and maximizing throughput during
database operations// Flexibility and Extensibility: JDBC provides flexibility for
DOM The Document Object Model (DOM) is a programming interface for web
developers to interact with databases at various levels of abstraction.// Security:
documents. It provides a structured representation of HTML (Hypertext Markup
Security is a crucial concern when interacting with databases. JDBC addresses security
Language), XHTML (Extensible Hypertext Markup Language), and XML (Extensible
requirements by supporting secure connections to databases, parameterized queries to
Markup Language) documents as a tree-like structure. The DOM represents the
prevent SQL injection attacks, and authentication mechanisms for user access control.//
structure of a web document as a hierarchical tree of objects, where each node in the
Scalability and Reliability: JDBC supports scalable and reliable database access
tree corresponds to a part of the document, such as an element, attribute, or text node.
solutions for enterprise-level applications.
KEY conc: Tree Structure: The DOM represents the structure of a document as a tree of
nodes. Each node in the tree represents an element, attribute, or text content within the
document./Nodes: There are different types of nodes in the DOM tree:
Java clas s In Java, a class is a blueprint or template that defines the structure and
Element Nodes: Represent HTML elements such as <div>, <p>, <span>, etc./Attribute
behavior of objects. It serves as a template for creating objects, which are instances of
that class. A class encapsulates data for the object (attributes or fields) and defines Nodes: Represent attributes of elements./Text Nodes: Represent text content within
elements.???Parent-Child Relationships: Nodes in the DOM tree have parent-child
operations that can be performed on the object (methods)//KEY CHARS OF: Attributes
relationships. An element node can have child nodes (other elements, text, or
(Fields): A class can have fields or attributes to represent data associated with objects
attributes), and it can also have a parent node.??Traversal and Manipulation: The
of that class. These attributes define the state of the objects.// Methods: A class can
DOM API provides methods for traversing and manipulating the DOM tree dynamically.
have methods that define the behavior or actions that objects of the class can perform.
Developers can programmatically access, create, modify, and delete elements and
Methods can manipulate the object's state and perform operations.// Constructors:
attributes in the document.
Constructors are special methods used for initializing objects. They have the same name
as the class and are called when an object is created.// Inheritance: Java supports
inheritance, allowing a class (subclass) to inherit properties and methods from another
class (superclass). This promotes code reusability and enables the creation of
hierarchical relationships between classes.// Polymorphism: Polymorphism allows
objects of different classes to be treated as objects of a common superclass.