Web Tech Merged
Web Tech Merged
RECENT POSTS
Home OE-EC704A OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 3(IMPORTANT TOPIC)
A class is a group of objects which have common properties. It is a template or blueprint from which
objects are created. It is a logical entity. It can't be physical.
Declaring a class
You can declare a class by writing the name of the next to the class keyword, followed by the flower
braces. Within these, you need to define the body (contents) of the class i.e. fields and methods.
To make the class accessible to all (classes) you need to make it public.
OE-EC704A Web Technology
Constructor in Java (MAKAUT SYLLABUS)
MODULE - 4(IMPORTANT
Whenever we use new keyword to create an instance of a class, the constructor is invoked and the TOPIC)
object of the class is returned. Since constructor can only return the object to class, it’s implicitly
December 10, 2022
done by java runtime and we are not supposed to add a return type to it.
public Employee() {
TAGS
System.out.println("Employee Constructor");
}
aptitude Current Affairs
Argument Passing
Pass-by-Value PAGES
When a parameter is pass-by-value, the caller and the callee method operate on two different • Home • Contact us
variables which are copies of each other. Any changes to one variable don't modify the other.
• Disclaimer • Privacy Policy
It means that while calling a method, parameters passed to the callee method will be clones of
original parameters. Any modification done in callee method will have no effect on the original
parameters in caller method. SOCIAL PLUGIN
Pass-by-Reference
When a parameter is pass-by-reference, the caller and the callee operate on the same object.
It means that when a variable is pass-by-reference, the unique identifier of the object is sent to the
method.
https://www.ecetopper.com/2022/12/oe-ec704a-web-technology-makaut_92.html 2/4
12/10/22, 12:19 PM OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 3(IMPORTANT TOPIC)
Method overloading
Method Overloading allows different methods to have the same name, but different signatures
where the signature can differ by the number of input parameters or type of input parameters, or a
mixture of both.
In other words, If a subclass provides the specific implementation of the method that has been
declared by one of its parent class, it is known as method overriding.
1. The method must have the same name as in the parent class
2. The method must have the same parameter as in the parent class.
3. There must be an IS-A relationship (inheritance).
Points to Remember
1. It allows Java to support overriding of methods, which are important for run-time
polymorphism.
2. It allows a class to define methods that will be shared by all its derived classes, while also
https://www.ecetopper.com/2022/12/oe-ec704a-web-technology-makaut_92.html 3/4
12/10/22, 12:19 PM OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 3(IMPORTANT TOPIC)
y
allowing these sub-classes to define their specific implementation of a few or all of those methods.
Share :
OLDER NEWER
OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE -
2(IMPORTANT TOPIC) 4(IMPORTANT TOPIC)
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
https://www.ecetopper.com/2022/12/oe-ec704a-web-technology-makaut_92.html 4/4
RECENT POSTS
Home OE-EC704A OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 5(IMPORTANT TOPIC)
Exception Handling in Java is one of the effective means to handle the runtime errors so that the
Show More
regular flow of the application can be preserved. Exception is an unwanted or unexpected event,
which occurs during the execution of a program, i.e. at run time, that disrupts the normal flow of the
program’s instructions.
FEATURED POST
Major reasons why an exception Occurs OE-EC704A
3. throw: The throw keyword is used to transfer control from the try block to the catch block.
4. throws: The throws keyword is used for exception handling without try & catch block. It specifies TAGS
the exceptions that a method can throw to the caller and does not handle itself.
aptitude Current Affairs
5. finally: It is executed after the catch block. We use it to put some common code (to be executed programming data structure
irrespective of whether an exception has occurred or not ) when there are multiple catch blocks.
Exception types
8051 PROGRAMMING
C PROGRAMMING QUIZ
Built-in Exceptions:Built-in exceptions are the exceptions that are available in Java libraries.
ArithmeticException: It is thrown when an exceptional condition has occurred in an arithmetic HR INTERVIEW QUESTIONS
operation.
ArrayIndexOutOfBoundsException: It is thrown to indicate that an array has been accessed with
an illegal index. The index is either negative or greater than or equal to the size of the array.
PAGES
ClassNotFoundException: This Exception is raised when we try to access a class whose definition is
not found • Home • Contact us
FileNotFoundException: This Exception is raised when a file is not accessible or does not open.
IOException: It is thrown when an input-output operation failed or interrupted • Disclaimer • Privacy Policy
Checked Exceptions
These are the exceptions that are checked at compile time. If some code within a method throws a
checked exception, then the method must either handle the exception or it must specify the SOCIAL PLUGIN
To create a custom exception in java, we have to create a class by extending it with an Exception
class from the java.lang package.
It's always a good practice to add comments and follow naming conventions to easily identify and
recognize the benefit of our exception class.
}
Share :
OLDER NEWER
OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE -
4(IMPORTANT TOPIC) 6(IMPORTANT TOPIC)
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Enter Comment
RECENT POSTS
Home OE-EC704A OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 6(IMPORTANT TOPIC)
object of the class is returned. Since constructor can only return the object to class, it’s implicitly
done by java runtime and we are not supposed to add a return type to it. If we add a return type to a
constructor, then it will become a method of the class.
As we know that objects are immutable, whenever you want to modify a String, you must either copy programming data structure
it into a StringBuffer or StringBuilder, or use a String method that constructs a new copy of the string 8051 PROGRAMMING
with your modifications complete. A sampling of these methods are described in this post.
C PROGRAMMING QUIZ
In this post, we will discuss below methods for modifying a String objects.
substring() HR INTERVIEW QUESTIONS
concat()
replace()
replaceAll()
replaceFirst() PAGES
trim()
• Home • Contact us
Java String valueOf()
• Disclaimer • Privacy Policy
The valueOf() method returns the string representation of the argument passed.
class Main {
SOCIAL PLUGIN
public static void main(String[] args) {
}
}
} Design by - Blogger Templates | Distributed by BloggerTemplate.org
Home About Contact us Privacy Policy Disclamer
// Output: 923.234
The append() method concatenates the given argument with this string.
2) insert() method
The insert() method inserts the given string with this string at the given position.
3) replace() method
The replace() method replaces the given string from the specified beginIndex and endIndex-1.
4) delete() method
The delete() method of StringBuffer class deletes the string from the specified beginIndex to
endIndex-1.
5) reverse() method
6) capacity() method
The capacity() method of StringBuffer class returns the current capacity of the buffer. The default
capacity of the buffer is 16. If the number of character increases from its current capacity, it
increases the capacity by (oldcapacity*2)+2.
For example if your current capacity is 16, it will be (16*2)+2=34.
Share :
OLDER NEWER
OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE -
5(IMPORTANT TOPIC) 7(IMPORTANT TOPIC)
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Enter Comment
RECENT POSTS
Home OE-EC704A OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 7(IMPORTANT TOPIC)
class HelloWorld {
System.out.println("Hello, World!");
}
8051 PROGRAMMING
In Java, the byte streams have a 3 phase mechanism:
C PROGRAMMING QUIZ
Split- The input data source is split into a stream by a spliterator. Java Spliterator interface is an
HR INTERVIEW QUESTIONS
internal iterator that breaks the stream into smaller parts for traversing over them.
Apply- The elements in the stream are processed.
Combine- After the elements are processed, they are again combined together to create a single
result. PAGES
FileInputStream- This class is used to read data from a file/source. The FileInputStream class has
constructors which we can use to create an instance of the FileInputStream class. • Home • Contact us
This is the Java classical method to take input, Introduced in JDK1.0. This method is used by wrapping
the System.in (standard input stream)
2.Design
Usingby
Scanner Class
- Blogger Templates | Distributed by BloggerTemplate.org Home About Contact us Privacy Policy Disclamer
This is probably the most preferred method to take input. The main purpose of the Scanner class is
to parse primitive types and strings using regular expressions
It has been becoming a preferred way for reading user’s input from the command line.
Writing console output using print() and println() methods
The PrintStream is a bult-in class that provides two methods print() and println() to write console
output. The print() and println() methods are the most widely used methods for console output.
Both print() and println() methods are used with System.out stream.
Reading and writing files
Reader, InputStreamReader, FileReader and BufferedReader
Reader is the abstract class for reading character streams. It implements the following fundamental
methods:
FileReader is a convenient class for reading text files using the default character encoding of the
operating system.
BufferedReader reads text from a character stream with efficiency (characters are buffered to avoid
frequently reading from the underlying stream) and provides a convenient method for reading a line
of text readLine().
Writer is the abstract class for writing character streams. It implements the following fundamental
methods:
FileWriter is a convenient class for writing text files using the default character encoding of the
operating system.
BufferedWriter writes text to a character stream with efficiency (characters, arrays and strings are
buffered to avoid frequently writing to the underlying stream) and provides a convenient method for
writing a line separator: newLine().
Share :
OLDER NEWER
OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE -
6(IMPORTANT TOPIC) 8(IMPORTANT TOPIC)
PAGES
Tags 7TH SEM OE-EC704A
• Home • Contact us
OLDER NEWER
OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - SOCIAL PLUGIN
7(IMPORTANT TOPIC) 9(IMPORTANT TOPIC)
Java Applet is a special type of small Java program embedded in the webpage to generate dynamic Show More
content .
Applet Architecture
FEATURED POST
We know that java provides console based programming language environment and window based OE-EC704A
The Applet and there class files are distribute through standard HTTP request and therefore can be
sent across firewall with the web page data. Applete code is referenced automatically each time the
user revisit the hosting website.
TAGS
Most applets override these four methods. These four methods forms Applet lifecycle. programming data structure
init() : init() is the first method to be called. This is where variable are initialized. This method is called
8051 PROGRAMMING
only once during the runtime of applet.
start() : start() method is called after init(). This method is called to restart an applet after it has been C PROGRAMMING QUIZ
stopped.
HR INTERVIEW QUESTIONS
stop() : stop() method is called to suspend thread that does not need to run when applet is not
visible.
destroy() : destroy() method is called when your applet needs to be removed completely from
memory. PAGES
Servlet Life Cycle Methods
• Home • Contact us
1. Servlet is borned
1. Servlet is borned
2. Servlet is initialized
Design by - Blogger Templates | Distributed by BloggerTemplate.org Home About Contact us Privacy Policy Disclamer
3. Servlet is ready to service
4. Servlet is servicing
5. Servlet is not ready to service
6. Servlet is destroyed
7. setForeground() and setBachground()methods
setForeground() is used to set the foreground colour i.e the colour in which text is shown. The
background colour can be changed to any colour by setBackground() BUT no matter what colour
given inside setForegorund() the text is always black.
Which method is used to show status in applet?
Applets display status lines with the showStatus method, inherited in the JApplet class from the
Applet class
The HTML <applet> tag specifies an applet. It is used for embedding a Java applet within an HTML
document.
How do I embed a Java applet in HTML?
To run an applet in a browser or in the JDK Applet Viewer, the applet needs to be added to an HTML
page, using the <APPLET> tag. You then specify the URL of the HTML page to your browser or the
Applet Viewer.
What is meant by getCodeBase() and getDocumentBase()
method?
- The getCodebase() method is also commonly used to establish a path to other files or folders that
are in the same location as the class being run.
- The getDocumentBase() method is used to return the URL of the directory in which the document is
resides.
How parameters are passed to an applet in Java?
Parameters passed to an applet
To pass the parameters to the Applet we need to use the param attribute of <applet> tag. To retrieve
a parameter's value, we need to use the getParameter() method of Applet class.
Share :
OLDER NEWER
OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE -
8(IMPORTANT TOPIC) 10(IMPORTANT TOPIC)
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Enter Comment
RECENT POSTS
Home OE-EC704A OE-EC704A Web Technology (MAKAUT SYLLABUS) MODULE - 10(IMPORTANT TOPIC)
An event can be defined as changing the state of an object or behavior by performing actions.
Actions can be a button click, cursor movement, keypress through keyboard or page scrolling, etc.
Classification of Events
Foreground Events
In JAVA, an adapter class allows the default implementation of listener interfaces. The notion of aptitude Current Affairs
listener interfaces stems from the Delegation Event Model. It is one of the many techniques used to
programming data structure
handle events in Graphical User Interface (GUI) programming languages, such as JAVA.
8051 PROGRAMMING
C PROGRAMMING QUIZ
Label is a passive control because it does not create any event when accessed by the user. The label
control is an object of Label. A label displays a single line of read-only text.
Button class is used to create a push button control, which can generate an ActionEvent when it is • Home • Contact us
clicked. In order to handle a button click event, ActionListener interface should be implemented.
• Disclaimer • Privacy Policy
Share :