SlideShare a Scribd company logo
1 of 22
OBJECT ORIENTEDPROGRAMING LANGUAGE
1.What is Multi threading
A process is a program in execution. Two or more processes running concurrently in a computer
is called multi tasking. In java it is term as multi threading.
Ex. While typing a document, we can take printout.
2. what is thread
 A single sequential flow of control.
 All programs have at least one thread-the main thread.
 More than one thread can executing concurrently.
3. types of computer
There are two types of computers .They are,
1.Uni processor
 One CPU
 One memory unit
 Simulated concurrency
2.Shared memory multiprocessor
 Many CPUs
 A single shared memory unit.
 True concurrency
4.Advantages of multithreading
 Reduces complexity of large programs.
 Maximizes CPU utilization.
 Increases the speed of execution.
5.Classes in thread
Java’s multi threading operation is based on the thread class. Thread is a class and it contains
constructors and methods for creating threads. Thread class is available in java.lang package. Thread
class contains different methods to control threads. They are,
1.Run( )
2.Start( )
3.Yield( )
4.Sleep( )
5.Stop( )
6.Suspend( )
7.Resume( )
8.Notify( )
6.defining and running a thread
A thread class can be created by extending the thread class. The thread class is available in
java.lang package.the following steps are followed to define and run a thread.
1.Declare the class by extending thread class.
2.Over ride the run( ) method in extended class.
3.Create the thread object using the class declared.
4.Call the start( ) method to initiate thread execution.
7. Life cycle of a thread
There are five states in a lifetime of a thread. at a time, the thread may be in any one of the
following five states.they are,
1.New born state
2.Runnable state
3.Running state
4.Blocked state
5.Dead state
8. Thread priorities
The programmer can set the priorities for threads. This can be done using setpriority( ) method
of thread class. The syntax is,
Threadname.setpriority (value);
The value is an integer value. This integer value must be between 1 to 10. In addition the thread
class defines some predefined constants also.
MIN_PRIORITY = 1
NORM_PRIORITY = 5
MAX_PRIORITY = 10
The default value is 5.
9.Thread scheduling
Allocating CPU time for the threads in the program is called thread scheduling.
10.thread synchronization
The data and the methods that are common to many threads may commonly be placed outside
the thread.
In such situations more than one thread can try to access the same method and data at the same
time or a thread can try to access the method that is currently in use by another thread.
This problem can be overcome by using a technique called synchronization the general form is,
Synchronized return-type method-name
{
---------------------------
Statements;
--------------------------
}
11.what is applet
Applets are java programs thart are used for internet applications. it can be executed using java
enabled web browser or using appletviewer. It can perform arithmetic operations, display graphics, play
sounds, accept user input and create animation there two types of applet. they are,
1. Local applet
2. Remote applet
12.Local applet
An applet developed locally and stored in a local computer is known as local applet.there is no
need for internet connection to execute local applets.
13.Remote applet
Remote applets are developed by someone else stored in remote computer. Internet connection is
needed to execute remote applet. If our system is connected to the internet, we can download the remote
applet onto our system via the internet and run it.
14.what is JAVA
 Java is an object oriented language developed by James Gosling and coworkers at SUN
Microsystems.
 Java began as a hardware independent language for powering small hand-held devices
such as complex remotes.
 Java’s hardware independence made it ideal for use on the web and in 1994 the HotJava
web browser was introduced. It was the first demo of interactive applets.
 In March 1995, it was announced that support for Java would be built into Netscape
Navigator. And thus began the rapid growth of Java.
15. what does mean by OBJECT ORIENTED
 An object is an instance of a class.
 A class is a programming construct that groups together data (properties) and functions
(methods) that can be performed on that data.
 For example, consider representing a chair
Properties Methods
Height Create
Width Destroy
Weight Move-X
Color Move-Y
X-Position Paint
Y-Position
16. what is JAVA APPLET
 Applets are Java programs that may be embedded into HTML documents. The applet
runs in the page as soon as it has been downloaded.
More specifically Java applets are Java programs that inherit the Applet (awt) or JApplet
class (swing).
17. life cycle of an applet
The life cycle of an Applet consists of inherited functions that are called at various times by the
applet container (browser).
 public void init()
{ // called when applet is first created }
 public void start()
{ // called when applet is started and then restarted }
 public void paint(Graphics G)
{ // invoked when screen needs to be drawn or redrawn }
 public void stop()
{ //called when the user leaves the page containing the applet }
 public void destroy()
{ // called when applet is permanently destroyed }
18.simple applet ideas
 A calculator for a desired property
 Body Mass Index or Bone Density for Allied Health
 Unit Conversion or PV=nRT for Physics or Chemistry
 Interest Calculations for Business and Management
 Quadratic formula or Pythagorean Theorem for Math
 A quote of the Day Generator
- create an array of strings (string [] quoteArray = new string[100];) holding the quotes and use a
random number generator to see which string gets passed to drawString(). The code to generate the
random number is:
Random r = new Random(seedValue);
index = r.nextInt() % quoteArray.length;
19. How to applet adding HTML
Insert the following where you wish the applet to appear:
<applet code=“MyApplet.class” height=“200” width=“100”>
<param name=“” value=“”> </param>
<param name=“” value=“”> </param>
<param name=“” value=“”> </param>
</applet>
20.what is inheritance
 Inheritance allows one to build a new class that builds onto the properties of an existing
class.
 Models an “is a” relationship. For example, a faculty member is person who possesses some
additional properties such as rank or number of publications.
 Inheritance keeps you from having to rewrite code. For example, Java applets are required
to have over 200 methods but inheritance takes care of most of them.
 In Java inheritance is indicated by using the extends keyword.
21.what is swing
Swing is a collection of classes and interfaces that one can use to display GUI components or
inherit from to create new components.
22.what is JDBC
JDBC stands for Java Data Base Connectivity. JDBC is used for to develop applications using
database withot considering the nature of the database. It is available in the Application Programming
Interface(API).
When using JDBC, an application program requests the driver manager to establish a connection
to aspecfied data source. In response, the driver manager searches its list of registered drivers and selects
one appropriate type to the datasource.once the driver is selected, the application communicates directly
with it, sending requests for data and receiving the results.this os shown in the following fig.
JDBC API CLASSES
JAVAPROGRAM JDBC DRIVER DBMS
MANAGER
JDBC DRIVER
23. important classes in JDBC
The important classes and interface of JDBC are available in the package java.sql.they are,
 Java.sql.driverManager
 Java.sql.Connection
 Java.sql.Statement
 Java.sql.PreparedStatement
 Java.sql.CallableStatement
 Java.sql.ResultSet
 Java.sql.SQLException
 Java.sql.SQLWarning
24.what are the JDBC drivers
Drivers is an interface which is used to connect the JDBC with the database. There are four types
of driver available. They are,
1. JDBC-ODBC Bridge
2. Native –API-Parity-Java Driver
3. JDBC-Net-All-Java driver
4. Native-Protocol-All-Java driver
25.Steps for JDBC
There are seven steps involved while establishing connection with database. They are,
1. Importing the java.sql package
2. Loading and registering the driver
3. Establishing the connection
4. Creating a statement
5. Executing the statement
6. Retrieving the result
7. Closing the connection and statement
26. Servlets
A servlet is like an applet, but on the server side.
 A servlet is any class that implements the javax.servlet.Servlet interface
 In practice, most servlets extend the javax.servlet.http.HttpServlet class
 Some servlets extend javax.servlet.GenericServlet instead
 Servlets, like applets, usually lack a main method, but must implement or override certain
other methods
 Client sends a request to server
 Server starts a servlet
 Servlet computes a result for server and does not quit
 Server returns response to client
 Another client sends a request
 Server calls the servlet again and etc.
27.Servers
 A server is a computer that responds to requests from a client
 Typical requests: provide a web page, upload or download a file, send email
 A server is also the software that responds to these requests; a client could be the browser
or other software making these requests
 Typically, your little computer is the client, and someone else’s big computer is the
server
 However, any computer can be a server
 It is not unusual to have server software and client software running on the same
computer.
servlet
28.what is apache
 Apache is a very popular server
 66% of the web sites on the Internet use Apache
Apache is:
 Full-featured and extensible
 Efficient
 Robust
 Secure (at least, more secure than other servers)
 Up to date with current standards
 Open source
 Free
29.what is port
 A port is a connection between a server and a client
 Ports are identified by positive integers
 A port is a software notion, not a hardware notion, so there may be very many of them
 A service is associated with a specific port
Typical port numbers:
 21—FTP, File Transfer Protocol
 22—SSH, Secure Shell
 25—SMTP, Simple Mail Transfer Protocol
 53—DNS, Domain Name Service
 80—HTTP, Hypertext Transfer Protocol
 8080—HTTP (used for testing HTTP)
 7648, 7649—CU-SeeMe
 27960—Quake III
These are the ports of
most interest to us
30.what is CGI
 CGI stands for “Common Gateway Interface
 Client sends a request to server
 Server starts a CGI script
 Script computes a result for server and quits
 Server returns response to client
 Another client sends a request
 Server starts the CGI script again
 Etc.
31. what is TOMCAT
 Tomcat is the Servlet Engine than handles servlet requests for Apache
 Tomcat is a “helper application” for Apache
 It’s best to think of Tomcat as a “servlet container”
 Apache can handle many types of web services
 Apache can be installed without Tomcat
 Tomcat can be installed without Apache
 It’s easier to install Tomcat standalone than as part of Apache
 By itself, Tomcat can handle web pages, servlets, and JSP
 Apache and Tomcat are open source (and therefore free).
32. introduction to Network programming
The Internet is all about connecting machines together. One of the most exciting
aspects of Java is that it incorporates an easy-to-use, cross-platform model for
network communications that makes it possible to learn network programming
without years of study. This opens up a whole new class of applications to
programmers.
33.what is socket
 Sockets provide an interface for programming networks at the transport layer.
 Network communication using Sockets is very much similar to performing file I/O
 In fact, socket handle is treated like file handle.
 The streams used in file I/O operation are also applicable to socket-based I/O
 Socket-based communication is programming language independent.
 That means, a socket program written in Java language can also communicate to a
program written in Java or non-Java socket program.
34.socket communication
A server (program) runs on a specific computer and has a socket that is bound to a specific port.
The server waits and listens to the socket for a client to make a connection request.
35.what are the java sockets
 A socket is an endpoint of a two-way communication link between two programs running
on the network.
 A socket is bound to a port number so that the TCP layer can identify the application that
data destined to be sent.
 Java’s .net package provides two classes:
 Socket – for implementing a client
36.How to implementing the Server
1. Open the Server Socket:
ServerSocket server;
DataOutputStream os;
DataInputStream is;
server = new ServerSocket( PORT );
2. Wait for the Client Request:
Socket client = server.accept();
3. Create I/O streams for communicating to the client
is = new DataInputStream( client.getInputStream() );
os = new DataOutputStream( client.getOutputStream() );
4. Perform communication with client
Receive from client: String line = is.readLine();
Send to client: os.writeBytes("Hellon");
5. Close sockets: client.close();
For multithreaded server:
while(true) {
i. wait for client requests (step 2 above)
ii. create a thread with “client” socket as parameter (the thread creates streams (as in step (3) and does
communication as stated in (4). Remove thread once service is provided.
}
37.what is internet address
Internet addresses are manipulated in Java by the use of the InetAddress class.
InetAddress takes care of the Domain Name System (DNS) look-up and reverse
look-up; IP addresses can be specified by either the host name or the raw IP
address. InetAddress provides methods to getByName(), getAllByName(),
getLocalHost(), getAddress(), etc.
38.what is IP address
IP addresses are a 32-bit number, often represented as a "quad" of four 8-bit
numbers separated by periods. They are organized into classes (A, B, C, D, andE) which are used to group
varying numbers of hosts in a hierarchical numbering
scheme.
Class A
1.0.0.0 to 126.255.255.255, inclusive. About 16 million IP addresses in a class A
domain.
Class B
128.1.0.0 to 191.254.255.255, inclusive. About 64 thousand IP addresses in a
class B domain.
Class C
192.0.1.0 to 223.255.254.255, inclusive. 256 IP addresses in a class C domain.
Class D
224.0.0.1 to 239.255.255.255, inclusive, denote multicast groups.
Class E
240.0.0.0 to 254.255.255.255, inclusive. Reserved for future use.
The IP address 127.0.0.1 is special, and is reserved to represent the loopback or
"localhost" address.
39.what is port number
The port number field of an IP packet is specified as a 16-bit unsigned integer.
This means that valid port numbers range from 1 through 65535. (Port number 0
is reserved and can't be used). Java does not have any unsigned data types,Java's short data type is 16 bits,
but its range is -32768 to 32767 since it is a signed type.
40.what is client/server computing
You can use the Java language to communicate with remote file systems using a client/server
model. A server listens for connection requests from clients across the network or even from the same
machine. Clients know how to connect to the server via an IP address and port number. Upon connection,
the server reads the request sent by the client and responds appropriately. In this way, applications can be
broken down into specific tasks that are accomplished in separatelocations.
41.what is socket exception
try {
Socket client = new Socket(host, port); handleConnection(client);
}
catch(UnknownHostException uhe) { System.out.println("Unknown host: " + host); uhe.printStackTrace();
}
catch(IOException ioe) {
System.out.println("IOException: " + ioe); ioe.printStackTrace();
}
42.define serversocket & exception
 public ServerSocket(int port) throws IOException
 Creates a server socket on a specified port.
 A port of 0 creates a socket on any free port. You can use getLocalPort() to identify the
(assigned) port on which this socket is listening.
 The maximum queue length for incoming connection indications (a request to connect) is
set to 50. If a connection indication arrives when the queue is full, the connection is refused.
 Throws:
 IOException - if an I/O error occurs when opening the socket.
 SecurityException - if a security manager exists and its checkListen method doesn't allow
the operation.
43.what is RMI
Remote method invocation allows applications to call object methods located remotely, sharing
resources and processing load across systems. Unlike other systems for remote execution which require that
only simple data types or defined structures be passed to and from methods, RMI allows any Java object type
to be used - even if the client or server has never encountered it before. RMI allows both client and server to
dynamically load new object types as required. In this article, you'll learn more about RMI.
44.Writing RMI services
Writing your own RMI services can be a little difficult at first, so we'll start off with an example
which isn't too ambitious. We'll create a service that can calculate the square of a number, and the power
of two numbers (238 for example). Due to the large size of the numbers, we'll use the java.math.BigInteger
class for returning values rather than an integer or a long.
45. Writing an interface
The first thing we need to do is to agree upon an interface, An interface is a description of the
methods we will allow remote clients to invoke. Let's consider exactly what we'll need.
1.A method that accepts as a parameter an integer, squares it, and returns a BigInteger public
BigInteger square ( int number_to_square );
2.A method that accepts as a parameter two integers, calculates their power, and returns a
BigInteger public BigInteger power ( int num1, int num2 );
46. implementimg the interface
Implementing the interface is a little more tricky - we actually have to write the square and
power methods! Don't worry if you're not sure how to calculate squares and powers, this isn't a math
lesson. The real code we need to be concerned about is the constructor and main method.
We have to declare a default constructor, even when we don't have any initialization code for our
service. This is because our default constructor can throw a java.rmi.RemoteException, from its parent
constructor in UnicastRemoteObject. Sound confusing? Don't worry, because our constructor is extremely
simple.
public PowerServiceServer () throws RemoteException
{
super();
}
47.what is RMI client
What good is a service, if you don't write a client that uses it? Writing clients is the easy part - all
a client has to do is call the registry to obtain a reference to the remote object, and call its methods. All the
underlying network communication is hidden from view, which makes RMI clients simple.
Our client must first assign a security manager, and then obtain a reference to the service. Note
that the client receives an instance of the interface we defined earlier, and not the actual implementation.
Some behind-the-scenes work is going on, but this is completely transparent to the client.
48. Running the client and server
More complex systems, however, might contain interfaces that change, or whose implementation
changes. To run this article's examples, both the client and server will have a copy of the classfiles, but more
advanced systems might share the code of the server on a webserver, for downloading as required. If your
systems do this, don't forget to set the system property java.rmi.server.codebase to the webserver directory in
which your classes are stored.
49.Perform the client and server
To perform the client and server, following the steps. They are,
1. Strat RMI registry
2. Compile the server
3. Start the server
4. Start the client
UNIT III
1) Introduction to JAVA:
Java is a pure object oriented general purpose language. Using java we can develop two types
of programs. They are:
i. Application programs
ii. Applet program
2) Define Application programs and Applet programs:
Application programs are programs to do jobs on a local computer.
Applet programs are programs that have an ability to run on internet through a web browser
3) Difference between Application and Applet
APPLICATION APPLET
1) Application can access the local file
system and resources.
2) Functionality of the applications are
known.
3) Author is known.
4) Creating and running an application is
easy.
5) This is executed by typing commands
on command line.
1) Restricted to access the local file
system and resources.
2) Functionality of applets are not known.
3) Author is not known.
4) Creating and running an applet is
complex.
5) This is executed by using applet viewer
or any browser.
4) What are the features of java program?
The features of java program are:
1. Simple, small and familiar.
2. Object Oriented.
3. Distributed
4. Robust
5. Secure
6. Architectural neutral (or) platform independent
7. Portable
8. Compiled and interpreted
9. High performance
10. Dynamic and extensible.
5) Give the command used for creating, compiling and execution of a program.
Java is a command driven language. So the programs are compiled and executed by giving
commands in command prompt.
1) Creating a program:
Create a program using any text editor such as edit in DOS or notepad or word pad
etc. and save it in java directory.
Syntax:
filename.java
2) Compiling the program:
Compile the created program using java compiler.
Syntax:
javac sourcefilename.java
3) Running the program:
Run the compiled program using java interpreter.
Syntax:
java classname
EXAMPLE:
Name of the source file- Sample.java
Name of the class file- Sample.class
To run the program-c>java sample
6) What are Java tokens?
A token is an individual element in java. A program is written by using the available
tokens. The various tokens are:
1. Keywords
2. Identifies
3. Constants or literals
4. Operators
5. Separators
7) What are keywords (or) define keyword with eg:
Keywords are words which belong to java language. They have standard predefined
meaning. The users have no right to change its meaning. Keywords should be written in
lowercase. The list of keywords are:
abstract, boolean, int, float, static, byte, char, for, if,… etc
8) Explain JVM:
Java compiler compiles the source code and produces a machine independent
intermediate code called bytecode. These intermediate codes are called java virtual machine
(JVM)
These intermediate codes can be used by any machine with the help of correct interpreter.
The interpreter produces the machine dependent code called machine code and can be run by
the computer.
Steps involved in executing a java program are:
User
Virtual Real Machine
Machine
9) Define Data types:
Data types specify the size and type of value that are to be stored. The data types are
defined into two categories. They are:
1) Primitive (or) built-in data types.
2) Derived (or) reference data types.
10) What are Primitive and Derived data types :
Primitive data types are data types available in language itself.
Derived data types are user defined data types.
Source
Code
Java
Compiler
Byte
code
Java
Interpreter
Machine
Code
The figure below shows the data types under various categories:
11) What is class?
A class is a user defined data type. It contains data and its related methods. The
general form is,
class classname
{
datatype field-1;
……..
…….
Datatypes
Primitive Derived
Numeric NonNumeric Class Arrays
Integer Real Character Boolean
byte Long
Float
Double
Short int
datatype field-n;
datatype methodname-1(parameter list)
{
body of the method
}
………
datatype method-n(parameter list)
{
body of the method
}
12) How variables are added to a class?
To add variable in a class it must be defined inside a class. At once a variable is
added to class it becomes instance variable.
eg: class student
{
int regno;
char name;
}
13) Define Methods:
Methods are used to access the data fields in a class. To add a method it must be
defined after the data field definition. At once a method is added to a class it becomes an
instance method or member function. The general form is,
datatype methodname(parameter list)
{
body of the method
}
14) How the objects are created?
Objects are created from the defined class. Using a class we can create any
number of objects. All created objects can use the instance variables. Memory space for
the instance variables will be allocated only during object creation.
15) List down the steps to create an object
i) Declare the objects:
Syntax:
classname obj1,obj2,….objn;
ii) Create memory space:
After object declaration, we must allocate memory space foe the instance
variables for each object. This is done with the help of new operator.
Syntax:
obj1= new classname();
obj2= new classname();
obj3= new classname();
…………..
…………..
objn= new classname();
16) Define Inheritance:
Inheritance is the process of creating new classes from the existing classes. The new
classes are called derived classes. The existing classes are called base classes.
The derived classes inherit all the properties of the base class plus its own properties.
The process of inheritance does not affect the base classes.
The figure given below shows the inheritance:
17) What are the types of inheritance and explain:
The different types of inheritance are:
1) Single inheritance
2) Multilevel Inheritance
3) Hierarchical Inheritance
4) Multiple Inheritance
1) SINGLE INHERITANCE:
A class derived from one superclass is called single inheritance.
2) MULTILEVEL INHERITANCE:
A class derived from other derived class is called multilevel inheritance
3) HIERARCHICAL INHERITANCE
More classes derived from one super class is called hierarchical
inheritance
4) MULTIPLE INHERITANCE:
A class derived from more than one superclass is called nultiple inheritance. But
java does not support direct implementation of multiple inheritance.
Property1
Property2
Property3
Property4
Property1
Property2
Property3
Property4
Base class
Inheritance
Inheritsfrombase class
Definedinthe derivedclass
Derived
class

More Related Content

What's hot

C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
Top 20 Asp.net interview Question and answers
Top 20 Asp.net interview Question and answersTop 20 Asp.net interview Question and answers
Top 20 Asp.net interview Question and answersw3asp dotnet
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Abdul Hannan
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interviewKuntal Bhowmick
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupBala Subra
 
C# interview-questions
C# interview-questionsC# interview-questions
C# interview-questionsnicolbiden
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview QuestionsKuntal Bhowmick
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slidesunny khan
 
Bt0074 oops with java
Bt0074 oops with javaBt0074 oops with java
Bt0074 oops with javaTechglyphs
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net AccentureSri K
 
Java interview-questions-and-answers
Java interview-questions-and-answersJava interview-questions-and-answers
Java interview-questions-and-answersbestonlinetrainers
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersKrishnaov
 
Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerVineet Kumar Saini
 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Ahmed Gad
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with javaMohamed Fathy
 

What's hot (20)

C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Top 20 Asp.net interview Question and answers
Top 20 Asp.net interview Question and answersTop 20 Asp.net interview Question and answers
Top 20 Asp.net interview Question and answers
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interview
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check Tuneup
 
C# interview-questions
C# interview-questionsC# interview-questions
C# interview-questions
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Ppt chapter03
Ppt chapter03Ppt chapter03
Ppt chapter03
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slide
 
Bt0074 oops with java
Bt0074 oops with javaBt0074 oops with java
Bt0074 oops with java
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
 
Database Management System-session1-2
Database Management System-session1-2Database Management System-session1-2
Database Management System-session1-2
 
Java features
Java featuresJava features
Java features
 
Java interview-questions-and-answers
Java interview-questions-and-answersJava interview-questions-and-answers
Java interview-questions-and-answers
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with java
 

Similar to OBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTES

Similar to OBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTES (20)

Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
SMI - Introduction to Java
SMI - Introduction to JavaSMI - Introduction to Java
SMI - Introduction to Java
 
Java multi thread programming on cmp system
Java multi thread programming on cmp systemJava multi thread programming on cmp system
Java multi thread programming on cmp system
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Java Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data StructuresJava Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data Structures
 
Android session-5-sajib
Android session-5-sajibAndroid session-5-sajib
Android session-5-sajib
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questions
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
Java notes
Java notesJava notes
Java notes
 
Learnadvancedjavaprogramming 131217055604-phpapp02
Learnadvancedjavaprogramming 131217055604-phpapp02Learnadvancedjavaprogramming 131217055604-phpapp02
Learnadvancedjavaprogramming 131217055604-phpapp02
 
Java 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENTJava 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENT
 
Intro to programing with java-lecture 1
Intro to programing with java-lecture 1Intro to programing with java-lecture 1
Intro to programing with java-lecture 1
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
 
Threadnotes
ThreadnotesThreadnotes
Threadnotes
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
ANDROID FDP PPT
ANDROID FDP PPTANDROID FDP PPT
ANDROID FDP PPT
 

More from suthi

THE ROLE OF EDGE COMPUTING IN INTERNET OF THINGS
THE ROLE OF EDGE COMPUTING IN INTERNET OF THINGSTHE ROLE OF EDGE COMPUTING IN INTERNET OF THINGS
THE ROLE OF EDGE COMPUTING IN INTERNET OF THINGSsuthi
 
EDGE COMPUTING: VISION AND CHALLENGES
EDGE COMPUTING: VISION AND CHALLENGESEDGE COMPUTING: VISION AND CHALLENGES
EDGE COMPUTING: VISION AND CHALLENGESsuthi
 
Document Classification Using KNN with Fuzzy Bags of Word Representation
Document Classification Using KNN with Fuzzy Bags of Word RepresentationDocument Classification Using KNN with Fuzzy Bags of Word Representation
Document Classification Using KNN with Fuzzy Bags of Word Representationsuthi
 
AUTOMATA THEORY - SHORT NOTES
AUTOMATA THEORY - SHORT NOTESAUTOMATA THEORY - SHORT NOTES
AUTOMATA THEORY - SHORT NOTESsuthi
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESsuthi
 
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTESSOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTESsuthi
 
COMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTESCOMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTESsuthi
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESsuthi
 
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTESSOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTESsuthi
 
ALGORITHMS - SHORT NOTES
ALGORITHMS - SHORT NOTESALGORITHMS - SHORT NOTES
ALGORITHMS - SHORT NOTESsuthi
 
COMPUTER NETWORKS - SHORT NOTES
COMPUTER NETWORKS - SHORT NOTESCOMPUTER NETWORKS - SHORT NOTES
COMPUTER NETWORKS - SHORT NOTESsuthi
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESsuthi
 
ARTIFICIAL INTELLIGENCE - SHORT NOTES
ARTIFICIAL INTELLIGENCE - SHORT NOTESARTIFICIAL INTELLIGENCE - SHORT NOTES
ARTIFICIAL INTELLIGENCE - SHORT NOTESsuthi
 
LIGHT PEAK
LIGHT PEAKLIGHT PEAK
LIGHT PEAKsuthi
 
Action Recognition using Nonnegative Action
Action Recognition using Nonnegative ActionAction Recognition using Nonnegative Action
Action Recognition using Nonnegative Actionsuthi
 
C Programming Tutorial
C Programming TutorialC Programming Tutorial
C Programming Tutorialsuthi
 
Data structure - mcqs
Data structure - mcqsData structure - mcqs
Data structure - mcqssuthi
 
Data base management systems ppt
Data base management systems pptData base management systems ppt
Data base management systems pptsuthi
 
Data base management systems question paper
Data base management systems question paperData base management systems question paper
Data base management systems question papersuthi
 
Dbms mcqs
Dbms mcqsDbms mcqs
Dbms mcqssuthi
 

More from suthi (20)

THE ROLE OF EDGE COMPUTING IN INTERNET OF THINGS
THE ROLE OF EDGE COMPUTING IN INTERNET OF THINGSTHE ROLE OF EDGE COMPUTING IN INTERNET OF THINGS
THE ROLE OF EDGE COMPUTING IN INTERNET OF THINGS
 
EDGE COMPUTING: VISION AND CHALLENGES
EDGE COMPUTING: VISION AND CHALLENGESEDGE COMPUTING: VISION AND CHALLENGES
EDGE COMPUTING: VISION AND CHALLENGES
 
Document Classification Using KNN with Fuzzy Bags of Word Representation
Document Classification Using KNN with Fuzzy Bags of Word RepresentationDocument Classification Using KNN with Fuzzy Bags of Word Representation
Document Classification Using KNN with Fuzzy Bags of Word Representation
 
AUTOMATA THEORY - SHORT NOTES
AUTOMATA THEORY - SHORT NOTESAUTOMATA THEORY - SHORT NOTES
AUTOMATA THEORY - SHORT NOTES
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
 
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTESSOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
 
COMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTESCOMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTES
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTES
 
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTESSOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
 
ALGORITHMS - SHORT NOTES
ALGORITHMS - SHORT NOTESALGORITHMS - SHORT NOTES
ALGORITHMS - SHORT NOTES
 
COMPUTER NETWORKS - SHORT NOTES
COMPUTER NETWORKS - SHORT NOTESCOMPUTER NETWORKS - SHORT NOTES
COMPUTER NETWORKS - SHORT NOTES
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
 
ARTIFICIAL INTELLIGENCE - SHORT NOTES
ARTIFICIAL INTELLIGENCE - SHORT NOTESARTIFICIAL INTELLIGENCE - SHORT NOTES
ARTIFICIAL INTELLIGENCE - SHORT NOTES
 
LIGHT PEAK
LIGHT PEAKLIGHT PEAK
LIGHT PEAK
 
Action Recognition using Nonnegative Action
Action Recognition using Nonnegative ActionAction Recognition using Nonnegative Action
Action Recognition using Nonnegative Action
 
C Programming Tutorial
C Programming TutorialC Programming Tutorial
C Programming Tutorial
 
Data structure - mcqs
Data structure - mcqsData structure - mcqs
Data structure - mcqs
 
Data base management systems ppt
Data base management systems pptData base management systems ppt
Data base management systems ppt
 
Data base management systems question paper
Data base management systems question paperData base management systems question paper
Data base management systems question paper
 
Dbms mcqs
Dbms mcqsDbms mcqs
Dbms mcqs
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 

OBJECT ORIENTED PROGRAMMING LANGUAGE - SHORT NOTES

  • 1. OBJECT ORIENTEDPROGRAMING LANGUAGE 1.What is Multi threading A process is a program in execution. Two or more processes running concurrently in a computer is called multi tasking. In java it is term as multi threading. Ex. While typing a document, we can take printout. 2. what is thread  A single sequential flow of control.  All programs have at least one thread-the main thread.  More than one thread can executing concurrently. 3. types of computer There are two types of computers .They are, 1.Uni processor  One CPU  One memory unit  Simulated concurrency 2.Shared memory multiprocessor  Many CPUs  A single shared memory unit.  True concurrency 4.Advantages of multithreading  Reduces complexity of large programs.  Maximizes CPU utilization.  Increases the speed of execution. 5.Classes in thread Java’s multi threading operation is based on the thread class. Thread is a class and it contains constructors and methods for creating threads. Thread class is available in java.lang package. Thread class contains different methods to control threads. They are, 1.Run( ) 2.Start( ) 3.Yield( ) 4.Sleep( ) 5.Stop( )
  • 2. 6.Suspend( ) 7.Resume( ) 8.Notify( ) 6.defining and running a thread A thread class can be created by extending the thread class. The thread class is available in java.lang package.the following steps are followed to define and run a thread. 1.Declare the class by extending thread class. 2.Over ride the run( ) method in extended class. 3.Create the thread object using the class declared. 4.Call the start( ) method to initiate thread execution. 7. Life cycle of a thread There are five states in a lifetime of a thread. at a time, the thread may be in any one of the following five states.they are, 1.New born state 2.Runnable state 3.Running state 4.Blocked state 5.Dead state 8. Thread priorities The programmer can set the priorities for threads. This can be done using setpriority( ) method of thread class. The syntax is, Threadname.setpriority (value); The value is an integer value. This integer value must be between 1 to 10. In addition the thread class defines some predefined constants also. MIN_PRIORITY = 1 NORM_PRIORITY = 5 MAX_PRIORITY = 10 The default value is 5.
  • 3. 9.Thread scheduling Allocating CPU time for the threads in the program is called thread scheduling. 10.thread synchronization The data and the methods that are common to many threads may commonly be placed outside the thread. In such situations more than one thread can try to access the same method and data at the same time or a thread can try to access the method that is currently in use by another thread. This problem can be overcome by using a technique called synchronization the general form is, Synchronized return-type method-name { --------------------------- Statements; -------------------------- } 11.what is applet Applets are java programs thart are used for internet applications. it can be executed using java enabled web browser or using appletviewer. It can perform arithmetic operations, display graphics, play sounds, accept user input and create animation there two types of applet. they are, 1. Local applet 2. Remote applet 12.Local applet An applet developed locally and stored in a local computer is known as local applet.there is no need for internet connection to execute local applets. 13.Remote applet Remote applets are developed by someone else stored in remote computer. Internet connection is needed to execute remote applet. If our system is connected to the internet, we can download the remote applet onto our system via the internet and run it.
  • 4. 14.what is JAVA  Java is an object oriented language developed by James Gosling and coworkers at SUN Microsystems.  Java began as a hardware independent language for powering small hand-held devices such as complex remotes.  Java’s hardware independence made it ideal for use on the web and in 1994 the HotJava web browser was introduced. It was the first demo of interactive applets.  In March 1995, it was announced that support for Java would be built into Netscape Navigator. And thus began the rapid growth of Java. 15. what does mean by OBJECT ORIENTED  An object is an instance of a class.  A class is a programming construct that groups together data (properties) and functions (methods) that can be performed on that data.  For example, consider representing a chair Properties Methods Height Create Width Destroy Weight Move-X Color Move-Y X-Position Paint Y-Position 16. what is JAVA APPLET  Applets are Java programs that may be embedded into HTML documents. The applet runs in the page as soon as it has been downloaded. More specifically Java applets are Java programs that inherit the Applet (awt) or JApplet class (swing).
  • 5. 17. life cycle of an applet The life cycle of an Applet consists of inherited functions that are called at various times by the applet container (browser).  public void init() { // called when applet is first created }  public void start() { // called when applet is started and then restarted }  public void paint(Graphics G) { // invoked when screen needs to be drawn or redrawn }  public void stop() { //called when the user leaves the page containing the applet }  public void destroy() { // called when applet is permanently destroyed } 18.simple applet ideas  A calculator for a desired property  Body Mass Index or Bone Density for Allied Health  Unit Conversion or PV=nRT for Physics or Chemistry  Interest Calculations for Business and Management  Quadratic formula or Pythagorean Theorem for Math  A quote of the Day Generator - create an array of strings (string [] quoteArray = new string[100];) holding the quotes and use a random number generator to see which string gets passed to drawString(). The code to generate the random number is: Random r = new Random(seedValue); index = r.nextInt() % quoteArray.length;
  • 6. 19. How to applet adding HTML Insert the following where you wish the applet to appear: <applet code=“MyApplet.class” height=“200” width=“100”> <param name=“” value=“”> </param> <param name=“” value=“”> </param> <param name=“” value=“”> </param> </applet> 20.what is inheritance  Inheritance allows one to build a new class that builds onto the properties of an existing class.  Models an “is a” relationship. For example, a faculty member is person who possesses some additional properties such as rank or number of publications.  Inheritance keeps you from having to rewrite code. For example, Java applets are required to have over 200 methods but inheritance takes care of most of them.  In Java inheritance is indicated by using the extends keyword. 21.what is swing Swing is a collection of classes and interfaces that one can use to display GUI components or inherit from to create new components. 22.what is JDBC JDBC stands for Java Data Base Connectivity. JDBC is used for to develop applications using database withot considering the nature of the database. It is available in the Application Programming Interface(API). When using JDBC, an application program requests the driver manager to establish a connection to aspecfied data source. In response, the driver manager searches its list of registered drivers and selects one appropriate type to the datasource.once the driver is selected, the application communicates directly with it, sending requests for data and receiving the results.this os shown in the following fig.
  • 7. JDBC API CLASSES JAVAPROGRAM JDBC DRIVER DBMS MANAGER JDBC DRIVER 23. important classes in JDBC The important classes and interface of JDBC are available in the package java.sql.they are,  Java.sql.driverManager  Java.sql.Connection  Java.sql.Statement  Java.sql.PreparedStatement  Java.sql.CallableStatement  Java.sql.ResultSet  Java.sql.SQLException  Java.sql.SQLWarning 24.what are the JDBC drivers Drivers is an interface which is used to connect the JDBC with the database. There are four types of driver available. They are, 1. JDBC-ODBC Bridge 2. Native –API-Parity-Java Driver 3. JDBC-Net-All-Java driver 4. Native-Protocol-All-Java driver 25.Steps for JDBC There are seven steps involved while establishing connection with database. They are, 1. Importing the java.sql package 2. Loading and registering the driver
  • 8. 3. Establishing the connection 4. Creating a statement 5. Executing the statement 6. Retrieving the result 7. Closing the connection and statement 26. Servlets A servlet is like an applet, but on the server side.  A servlet is any class that implements the javax.servlet.Servlet interface  In practice, most servlets extend the javax.servlet.http.HttpServlet class  Some servlets extend javax.servlet.GenericServlet instead  Servlets, like applets, usually lack a main method, but must implement or override certain other methods  Client sends a request to server  Server starts a servlet  Servlet computes a result for server and does not quit  Server returns response to client  Another client sends a request  Server calls the servlet again and etc. 27.Servers  A server is a computer that responds to requests from a client  Typical requests: provide a web page, upload or download a file, send email  A server is also the software that responds to these requests; a client could be the browser or other software making these requests  Typically, your little computer is the client, and someone else’s big computer is the server  However, any computer can be a server  It is not unusual to have server software and client software running on the same computer. servlet
  • 9. 28.what is apache  Apache is a very popular server  66% of the web sites on the Internet use Apache Apache is:  Full-featured and extensible  Efficient  Robust  Secure (at least, more secure than other servers)  Up to date with current standards  Open source  Free 29.what is port  A port is a connection between a server and a client  Ports are identified by positive integers  A port is a software notion, not a hardware notion, so there may be very many of them  A service is associated with a specific port Typical port numbers:  21—FTP, File Transfer Protocol  22—SSH, Secure Shell  25—SMTP, Simple Mail Transfer Protocol  53—DNS, Domain Name Service  80—HTTP, Hypertext Transfer Protocol  8080—HTTP (used for testing HTTP)  7648, 7649—CU-SeeMe  27960—Quake III These are the ports of most interest to us
  • 10. 30.what is CGI  CGI stands for “Common Gateway Interface  Client sends a request to server  Server starts a CGI script  Script computes a result for server and quits  Server returns response to client  Another client sends a request  Server starts the CGI script again  Etc. 31. what is TOMCAT  Tomcat is the Servlet Engine than handles servlet requests for Apache  Tomcat is a “helper application” for Apache  It’s best to think of Tomcat as a “servlet container”  Apache can handle many types of web services  Apache can be installed without Tomcat  Tomcat can be installed without Apache  It’s easier to install Tomcat standalone than as part of Apache  By itself, Tomcat can handle web pages, servlets, and JSP  Apache and Tomcat are open source (and therefore free). 32. introduction to Network programming The Internet is all about connecting machines together. One of the most exciting aspects of Java is that it incorporates an easy-to-use, cross-platform model for network communications that makes it possible to learn network programming without years of study. This opens up a whole new class of applications to programmers. 33.what is socket  Sockets provide an interface for programming networks at the transport layer.  Network communication using Sockets is very much similar to performing file I/O
  • 11.  In fact, socket handle is treated like file handle.  The streams used in file I/O operation are also applicable to socket-based I/O  Socket-based communication is programming language independent.  That means, a socket program written in Java language can also communicate to a program written in Java or non-Java socket program. 34.socket communication A server (program) runs on a specific computer and has a socket that is bound to a specific port. The server waits and listens to the socket for a client to make a connection request. 35.what are the java sockets  A socket is an endpoint of a two-way communication link between two programs running on the network.  A socket is bound to a port number so that the TCP layer can identify the application that data destined to be sent.  Java’s .net package provides two classes:  Socket – for implementing a client 36.How to implementing the Server 1. Open the Server Socket: ServerSocket server; DataOutputStream os; DataInputStream is; server = new ServerSocket( PORT ); 2. Wait for the Client Request: Socket client = server.accept(); 3. Create I/O streams for communicating to the client is = new DataInputStream( client.getInputStream() );
  • 12. os = new DataOutputStream( client.getOutputStream() ); 4. Perform communication with client Receive from client: String line = is.readLine(); Send to client: os.writeBytes("Hellon"); 5. Close sockets: client.close(); For multithreaded server: while(true) { i. wait for client requests (step 2 above) ii. create a thread with “client” socket as parameter (the thread creates streams (as in step (3) and does communication as stated in (4). Remove thread once service is provided. } 37.what is internet address Internet addresses are manipulated in Java by the use of the InetAddress class. InetAddress takes care of the Domain Name System (DNS) look-up and reverse look-up; IP addresses can be specified by either the host name or the raw IP address. InetAddress provides methods to getByName(), getAllByName(), getLocalHost(), getAddress(), etc. 38.what is IP address IP addresses are a 32-bit number, often represented as a "quad" of four 8-bit numbers separated by periods. They are organized into classes (A, B, C, D, andE) which are used to group varying numbers of hosts in a hierarchical numbering scheme. Class A 1.0.0.0 to 126.255.255.255, inclusive. About 16 million IP addresses in a class A domain. Class B 128.1.0.0 to 191.254.255.255, inclusive. About 64 thousand IP addresses in a class B domain. Class C 192.0.1.0 to 223.255.254.255, inclusive. 256 IP addresses in a class C domain. Class D 224.0.0.1 to 239.255.255.255, inclusive, denote multicast groups. Class E
  • 13. 240.0.0.0 to 254.255.255.255, inclusive. Reserved for future use. The IP address 127.0.0.1 is special, and is reserved to represent the loopback or "localhost" address. 39.what is port number The port number field of an IP packet is specified as a 16-bit unsigned integer. This means that valid port numbers range from 1 through 65535. (Port number 0 is reserved and can't be used). Java does not have any unsigned data types,Java's short data type is 16 bits, but its range is -32768 to 32767 since it is a signed type. 40.what is client/server computing You can use the Java language to communicate with remote file systems using a client/server model. A server listens for connection requests from clients across the network or even from the same machine. Clients know how to connect to the server via an IP address and port number. Upon connection, the server reads the request sent by the client and responds appropriately. In this way, applications can be broken down into specific tasks that are accomplished in separatelocations. 41.what is socket exception try { Socket client = new Socket(host, port); handleConnection(client); } catch(UnknownHostException uhe) { System.out.println("Unknown host: " + host); uhe.printStackTrace(); } catch(IOException ioe) { System.out.println("IOException: " + ioe); ioe.printStackTrace(); } 42.define serversocket & exception  public ServerSocket(int port) throws IOException  Creates a server socket on a specified port.  A port of 0 creates a socket on any free port. You can use getLocalPort() to identify the (assigned) port on which this socket is listening.  The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connection indication arrives when the queue is full, the connection is refused.
  • 14.  Throws:  IOException - if an I/O error occurs when opening the socket.  SecurityException - if a security manager exists and its checkListen method doesn't allow the operation. 43.what is RMI Remote method invocation allows applications to call object methods located remotely, sharing resources and processing load across systems. Unlike other systems for remote execution which require that only simple data types or defined structures be passed to and from methods, RMI allows any Java object type to be used - even if the client or server has never encountered it before. RMI allows both client and server to dynamically load new object types as required. In this article, you'll learn more about RMI. 44.Writing RMI services Writing your own RMI services can be a little difficult at first, so we'll start off with an example which isn't too ambitious. We'll create a service that can calculate the square of a number, and the power of two numbers (238 for example). Due to the large size of the numbers, we'll use the java.math.BigInteger class for returning values rather than an integer or a long. 45. Writing an interface The first thing we need to do is to agree upon an interface, An interface is a description of the methods we will allow remote clients to invoke. Let's consider exactly what we'll need. 1.A method that accepts as a parameter an integer, squares it, and returns a BigInteger public BigInteger square ( int number_to_square ); 2.A method that accepts as a parameter two integers, calculates their power, and returns a BigInteger public BigInteger power ( int num1, int num2 ); 46. implementimg the interface Implementing the interface is a little more tricky - we actually have to write the square and power methods! Don't worry if you're not sure how to calculate squares and powers, this isn't a math lesson. The real code we need to be concerned about is the constructor and main method.
  • 15. We have to declare a default constructor, even when we don't have any initialization code for our service. This is because our default constructor can throw a java.rmi.RemoteException, from its parent constructor in UnicastRemoteObject. Sound confusing? Don't worry, because our constructor is extremely simple. public PowerServiceServer () throws RemoteException { super(); } 47.what is RMI client What good is a service, if you don't write a client that uses it? Writing clients is the easy part - all a client has to do is call the registry to obtain a reference to the remote object, and call its methods. All the underlying network communication is hidden from view, which makes RMI clients simple. Our client must first assign a security manager, and then obtain a reference to the service. Note that the client receives an instance of the interface we defined earlier, and not the actual implementation. Some behind-the-scenes work is going on, but this is completely transparent to the client. 48. Running the client and server More complex systems, however, might contain interfaces that change, or whose implementation changes. To run this article's examples, both the client and server will have a copy of the classfiles, but more advanced systems might share the code of the server on a webserver, for downloading as required. If your systems do this, don't forget to set the system property java.rmi.server.codebase to the webserver directory in which your classes are stored. 49.Perform the client and server To perform the client and server, following the steps. They are, 1. Strat RMI registry 2. Compile the server 3. Start the server 4. Start the client UNIT III 1) Introduction to JAVA: Java is a pure object oriented general purpose language. Using java we can develop two types of programs. They are: i. Application programs ii. Applet program
  • 16. 2) Define Application programs and Applet programs: Application programs are programs to do jobs on a local computer. Applet programs are programs that have an ability to run on internet through a web browser 3) Difference between Application and Applet APPLICATION APPLET 1) Application can access the local file system and resources. 2) Functionality of the applications are known. 3) Author is known. 4) Creating and running an application is easy. 5) This is executed by typing commands on command line. 1) Restricted to access the local file system and resources. 2) Functionality of applets are not known. 3) Author is not known. 4) Creating and running an applet is complex. 5) This is executed by using applet viewer or any browser. 4) What are the features of java program? The features of java program are: 1. Simple, small and familiar. 2. Object Oriented. 3. Distributed 4. Robust 5. Secure 6. Architectural neutral (or) platform independent 7. Portable 8. Compiled and interpreted 9. High performance 10. Dynamic and extensible. 5) Give the command used for creating, compiling and execution of a program.
  • 17. Java is a command driven language. So the programs are compiled and executed by giving commands in command prompt. 1) Creating a program: Create a program using any text editor such as edit in DOS or notepad or word pad etc. and save it in java directory. Syntax: filename.java 2) Compiling the program: Compile the created program using java compiler. Syntax: javac sourcefilename.java 3) Running the program: Run the compiled program using java interpreter. Syntax: java classname EXAMPLE: Name of the source file- Sample.java Name of the class file- Sample.class To run the program-c>java sample 6) What are Java tokens? A token is an individual element in java. A program is written by using the available tokens. The various tokens are: 1. Keywords 2. Identifies 3. Constants or literals 4. Operators 5. Separators
  • 18. 7) What are keywords (or) define keyword with eg: Keywords are words which belong to java language. They have standard predefined meaning. The users have no right to change its meaning. Keywords should be written in lowercase. The list of keywords are: abstract, boolean, int, float, static, byte, char, for, if,… etc 8) Explain JVM: Java compiler compiles the source code and produces a machine independent intermediate code called bytecode. These intermediate codes are called java virtual machine (JVM) These intermediate codes can be used by any machine with the help of correct interpreter. The interpreter produces the machine dependent code called machine code and can be run by the computer. Steps involved in executing a java program are: User Virtual Real Machine Machine 9) Define Data types: Data types specify the size and type of value that are to be stored. The data types are defined into two categories. They are: 1) Primitive (or) built-in data types. 2) Derived (or) reference data types. 10) What are Primitive and Derived data types : Primitive data types are data types available in language itself. Derived data types are user defined data types. Source Code Java Compiler Byte code Java Interpreter Machine Code
  • 19. The figure below shows the data types under various categories: 11) What is class? A class is a user defined data type. It contains data and its related methods. The general form is, class classname { datatype field-1; …….. ……. Datatypes Primitive Derived Numeric NonNumeric Class Arrays Integer Real Character Boolean byte Long Float Double Short int
  • 20. datatype field-n; datatype methodname-1(parameter list) { body of the method } ……… datatype method-n(parameter list) { body of the method } 12) How variables are added to a class? To add variable in a class it must be defined inside a class. At once a variable is added to class it becomes instance variable. eg: class student { int regno; char name; } 13) Define Methods: Methods are used to access the data fields in a class. To add a method it must be defined after the data field definition. At once a method is added to a class it becomes an instance method or member function. The general form is, datatype methodname(parameter list) {
  • 21. body of the method } 14) How the objects are created? Objects are created from the defined class. Using a class we can create any number of objects. All created objects can use the instance variables. Memory space for the instance variables will be allocated only during object creation. 15) List down the steps to create an object i) Declare the objects: Syntax: classname obj1,obj2,….objn; ii) Create memory space: After object declaration, we must allocate memory space foe the instance variables for each object. This is done with the help of new operator. Syntax: obj1= new classname(); obj2= new classname(); obj3= new classname(); ………….. ………….. objn= new classname(); 16) Define Inheritance: Inheritance is the process of creating new classes from the existing classes. The new classes are called derived classes. The existing classes are called base classes. The derived classes inherit all the properties of the base class plus its own properties. The process of inheritance does not affect the base classes. The figure given below shows the inheritance:
  • 22. 17) What are the types of inheritance and explain: The different types of inheritance are: 1) Single inheritance 2) Multilevel Inheritance 3) Hierarchical Inheritance 4) Multiple Inheritance 1) SINGLE INHERITANCE: A class derived from one superclass is called single inheritance. 2) MULTILEVEL INHERITANCE: A class derived from other derived class is called multilevel inheritance 3) HIERARCHICAL INHERITANCE More classes derived from one super class is called hierarchical inheritance 4) MULTIPLE INHERITANCE: A class derived from more than one superclass is called nultiple inheritance. But java does not support direct implementation of multiple inheritance. Property1 Property2 Property3 Property4 Property1 Property2 Property3 Property4 Base class Inheritance Inheritsfrombase class Definedinthe derivedclass Derived class