0% found this document useful (0 votes)
36 views28 pages

Unit I

Uploaded by

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

Unit I

Uploaded by

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

SRI KRISHNA ADITHYA

COLLEGE OF ARTS AND SCIENCE


(Affiliated to Bharathiar University)
Kovaipudur, Coimbatore-42

DEPARTMENT OF COMPUTER SCIENCE

COURSE MATERIAL UNIT WISE

SEMESTER III

CORE III- JAVA PROGRAMMING


UNIT – I

Fundamentals of Object Oriented Programming


Object-Oriented Paradigm
Basic Concepts of Object-Oriented Programming
Benefits of Object-Oriented Programming
Application of Object-Oriented Programming
Java Evolution:
History
Features
How Java differs from C and C++
Java and Internet
Java and www
Web Browsers
Overview of Java: simple Java program
Structure
Java Tokens
Statements
Java Virtual Machine

1.1 What is Programming Language


 A programming language is a formal language comprising a set of instructions that
produce various kinds of output. Programming languages are used in computer
programming to
implement algorithms.
 The portion of the language that a
computer can understand is called a
“binary.” Translating programming
language into binary is known as
“compiling.”
 Each language, from C Language to
Python, has its own distinct features,
though many times there are commonalities between programming languages.
 These languages allow computers to quickly and efficiently process large and complex
swaths of information.
 For example, if a person is given a list of randomized numbers ranging from one to ten
thousand and is asked to place them in ascending order, chances are that it will take a
sizable amount of time and include some errors.

1.2 Fundamentals of Object Oriented Programming


 Object Oriented Programming used to develop programs revolving around the real
world entities.
 In OOPs programming model, programs are developed around data rather than
actions and logics.
 In OOPs, every real life object has properties and behavior which is achieved through
the class and object creation.
 They contains properties (variables of some type) and behavior (methods).
 Most popular programming languages like Java, C++, C#, Ruby, etc. follow an object-
oriented programming paradigm.
 As JAVA being the most sought-after skill, we will talk about object-oriented
programming concepts in Java.

1.3 Object Oriented Programming Paradigm

 Object-oriented programming (OOP) is a programming paradigm based


upon objects (having both data and methods) that
aims to incorporate the advantages of modularity and
reusability. Objects, which are usually instances of
classes, are used to interact with one another to
design applications and computer programs.

 It utilizes several techniques from previously


established paradigms, including inheritance,
modularity, polymorphism, and encapsulation.

 Today, many popular programming languages (such


as Ada, C++, Delphi, Java, Lisp, SmallTalk, Perl, PHP,
Python, Ruby, VB.Net, Visual FoxPro, and Visual Prolog)
support OOP.

1.3.1Some of the striking features of object-oriented programming are


 Emphasis is on data rather than procedure.

 Programs are divided into what are known as objects.

 Data structures are designed such that they characterize the objects.

 Data is hidden and cannot be accessed by external functions.

 Objects may communicate with each other through functions.

 New data and functions can be easily added whenever necessary.

 Follows bottom-up approach in program design.

1.4 Basic Concepts of Object-Oriented Programming

 Object oriented programming is a type of programming which uses objects and


classes its functioning.
 The object oriented programming is based on real world entities like inheritance,
polymorphism, data hiding, etc.
 It aims at binding together data and function work on these data sets into a single
entity to restrict their usage.

Some basic concepts of object oriented programming are −


 CLASS

 OBJECTS

 ENCAPSULATION

 POLYMORPHISM

 INHERITANCE

 ABSTRACTION

Class
 A class is a data-type that has its own members i.e. data members and member
functions. It is the blueprint for an object in object oriented programming language.
 It is the basic building block of object oriented programming in c++. The members of a
class are accessed in programming language by creating an instance of the class.

Some important properties of class are −


 Class is a user-defined data-type.
 A class contains members like data members and member functions.
 Data members are variables of the class.
 Member functions are the methods that are used to manipulate data members.
 Data members define the properties of the class whereas the member functions define
the behaviour of the class.
A class can have multiple objects which have properties and behaviour that in common for all
of them.
Syntax
class class_name {
data_tpye data_name;
return_type method_name(parameters);
}

Object

 An object is an instance of a class. It is an entity with characteristics and


behaviour that are used in the object oriented programming.

 An object is the entity that is created to allocate memory. A class when


defined does not have memory chunk itself which will be allocated as soon as objects
are created.
Syntax
class_name object_name;

Encapsulation

 In object oriented programming, encapsulation is the concept of wrapping


together of data and information in a single unit.

 A formale defination of encapsulation would be: encapsulation is binding


togather the data and related function that can manipulate the data.

Let’s understand the topic with an easy real life example,

 In our colleges, we have departments for each course like computer science,
information technology, Computer Application, etc. each of these departments have
their own students and subjects that are kept track of and being taught.
 let's think of each department as a class that encapsulates the data about students of
that department and the subjects that are to be taught.
 Also a department has some fixed rules and guidelines that are to be followed by the
students that course like timings, methods used while learning, etc. this is
encapsulation in real life, there are data and there are ways to manipulate data.

Polymorphism
 The name defines polymorphism is multiple forms. which means polymorphism is the
ability of object oriented programming to do some work using multiple forms. The
behaviour of the method is dependent on the type or the situation in which the method
is called.
 Let‟s take a real life example, A person can have more than one behaviour depending
upon the situation. like a woman a mother, manager and a daughter And this define
her behaviour. This is from where the concept of polymorphism came from.
 In C++ programming language, polymorphism is achieved using two ways. They are
operator overloading and function overloading.

Operator overloading

 In operator overloading and operator can have multiple behaviour in different


instances of usage.

Function overloading
 Functions with the same name that can do multiple types based on some condition.

Inheritance

 It is the capability of a class to inherit or derive properties or characteristics other


class.
 It is very important and object oriented program as it allows reusability i.e. using a
method defined in another class by using inheritance.
 The class that derives properties from other class is known as child class or subclass
and the class from which the properties are inherited is base class or parent class.

C ++ programming language supports the following types of inheritance

 single inheritance

 multiple inheritance

 multi level inheritance

 Hierarchical inheritance

 hybrid inheritance

Abstraction

 Data abstraction or Data Hiding is the concept of hiding data and showing only
relevant data to the final user. It is also an important part object oriented programing.
 let's take real life example to understand concept better, when we ride a bike we only
know that pressing the brake will stop the bike and rotating the throttle will accelerate
but you don't know how it works and it is also not think we should know that's why this
is done from the same as a concept data abstraction.
 In C++ programming language write two ways using which we can accomplish data
abstraction −

 using class

 using header file

1.5 Benefits of OOP

There are several benefits of OOP to both program designer and the user. Object orientation
solves many problems which are associated with the development and quality of software
products. New technology gives greater programmer productivity, good quality of software
and low maintanance cost. The main advantages are:
 We can eliminate redundant code and extend the use of existing classes.

 Programs can be build from the standard working modules that


communicate with one another and to start writing the code from scratch. This shows
to saving of development time and higher productivity.

 The data hiding rules helps the programmer to make secure programs that
cannot be invaded by code in other parts of the program.

 It has multiple objects to coexist without any interference.

 It has map objects in the problem domain to those objects in the program.

 partition of work is easy in a project based on objects.

 The data-centered design approach capture more details of a model in an


implementable form.

 Object oriented systems can be easily upgraded from small to large


systems.

 It is possible to easily manage software complexity.

1.6 Applications of OOP

If there is complexity in software development, objecet-oriented programming is the best


paradigm to solve the problem. The following areas make the use of OOP:

1. Image Processing
2. Pattern Recognition
3. Computer Assisted Concurrent Engineering
4. Computer Aided Design and Manufacturing
5. Computer Aided Teaching
6. Intelligent Systems
7. Database Management Systems
8. Web based Applications
9. Distributed Computing and Applications
10. Component based Applications
11. Business Process Reengineering
12. Enterprise resource planning
13. Data security and management
14. Mobile Computing
15. Data Warehouse and Data Mining
16. Parallel Computing

 Object concept helps to translate our thoughts to a program. It provides a way of


solving a problem in the same way as a human being perceives a real world problem
and finds out the solution.
 It is possible to construct large reusable components using object-oriented techniques.
Development of reusable components is rapidly growing in commercial software
industries.

1.7 Java Evolution

Java History:

 Java is a programming language originally developed by


James Gosling at Sun Microsystems (which has since
merged into Oracle Corporation) and released in 1995 as
a core component of Sun Microsystems' Java platform.

 The language derives much of its syntax from C and C++,


but it has fewer low-level facilities than either of them.
Java applications are typically compiled to bytecode (class
file) that can run on any Java virtual machine (JVM)
regardless of computer architecture.

 Java is a general-purpose, concurrent, class-based,


object-oriented language that is specifically designed to
have as few implementation dependencies as possible.

 It is intended to let application developers "write once, run anywhere" (WORA),


meaning that code that runs on one platform does not need to be recompiled to run on
another.

 Java is as of 2012 one of the most popular programming languages in use, particularly
for client-server web applications, with a reported 10 million users.

 The original and reference implementation Java compilers, virtual machines, and class
libraries were developed by Sun from 1991 and first released in 1995.
 As of May 2007, in compliance with the specifications of the Java Community
Process, Sun relicensed most of its Java technologies under the GNU General Public
License.

 Others have also developed alternative implementations of these Sun technologies,


such as the GNU Compiler for Java and GNU Classpath.

Milestones of Java
1.5 Java features:
The inventors of java wanted to design a language which could offer solutions to some
of the problems encountered in modern programming they wanted the language to be not
only reliable, portable and distributed but also simple, compact and interactive
Sun micro System officially describes java with the following attributes:
 Compiled and interpreted
 Platform _independent and portable
 Object-oriented
 Robust and secure
 Distributed
 Familiar, simple and interactive
 High performance
 Dynamic and Extensible
 Ease of development
 Scalability of performance
 Monitoring and manageability
 desktop client
 Core XML support
 Supplementary character support
 JDBC Rowset
These features have made java the first application language of the World Wide Web java
will also become the premier language for general purpose standalone application
Simple and powerful
 Object oriented to java
 You can learn to program in java quickly once the basic concepts of object-oriented
programming are understood.
 You once need to understand a few concepts in order to write productive and
satisfying program.
 This style of simplicity has often produced inefficient and non-expressive “scripting
language”.
 Java is not scripting language.
Safe
 Java is protocol, it provide security and safe.
 Even your word processor documents can carry viruses.
 One of the key design principles of java is safety and security.
Object-oriented
 Class and object are used in java.
 Most other object-oriented systems have chosen to have rigid, hard-to –manage
object hierarchies.
 It is not a direct derivative of any other programming language, nor is‟t in any way
upward compatible with one.
Robust
 It is very strong it is a case sensitive language.
 You might think that robustness is a luxury in these times of adventure on the internet.
 Java is a very strict language when it comes to type and declarations, most common
errors can be caught time.
Interactive
 Requirements real word event It is very interactive to use.
 Java was designed to meet the real-word requirement of creating interactive network
program.
 Most systems have a hard time dealing with either
 One, let alone interactivity and networking at once.
Architecture neutral
 Portable language.
 Run anywhere at any time.
 It‟s work on “macintosh, pc, unix” and whatever the platforms can offer.
Interpreted and high performance
 Java is the byte code format it‟s carefully design.
 All platforms are independent.
 It‟s easy to translate directly into native machine code for very high performance.
Easy to learn
 The language features feel like the natural way to do things and encourage good
programming style.
 Java is more complicated then a scripting language.
 It‟s an object-oriented program.
Java is Compiled and Interpreted

Java compiler

Architecture Neutral & Portable


 Java Compiler - Java source code (file with extension .java) to bytecode (file with
extension .class)
 Bytecode - an intermediate form, closer to machine representation
 A interpreter (virtual machine) on any target platform interprets the bytecode.
 Porting the java system to any new platform involves writing an interpreter.
 The interpreter will figure out what the equivalent machine dependent code to run
 Core Classes

Total Platform Independence


Rich Class Environment
 Language
 Utilities
 Input/Output
 Low-Level Networking
 Abstract Graphical User Interface
 Internet Classes
 TCP/IP Networking
 WWW and HTML
 Distributed Programs

1.6 How JAVA differs from C and C++


Java and C

Java is not lot like C but the major difference between Java and C is that Java is an object-
oriented language and has a mechanism to define classes and objects. In an effort to build a
simple and safe language, the Java team did not include some of the C features in Java.

1. Java does not include the C unique statement keywords size of and typedef.
2. Java does not contain the data type struct and union.
3. Java does not define the type modifiers keywords auto, extern, register, signed, and
unsigned.
4. Java does not support an explicit pointer type.
5. Java does not have a preprocessor and therefore we cannot use # define, # include,
and # ifdef statements.
6. Java requires that the functions with no arguments must be declared with empty
parenthesis and not with the void keyword as done in C.
7. Java adds new operators such as instanceof and >>>.
8. Java adds labelled break and continue statements.
9. Java adds many features required for object-oriented programming.

C Programming Java Programming

It does include the unique statement It does not include the C unique statement
keywords sizeof, and typedef. keywords sizeof, and typedef.

It contain the data type struct and union. It does not contain the data type struct and union.
C Programming Java Programming

It define the type modifiers keywords It does not define the type modifiers keywords
auto, extern, register, signed, and auto, extern, register, signed, and unsigned.
unsigned.

It supports an explicit pointer type. It does not support an explicit pointer type.

It has a preprocessor and therefore we It does not have a preprocessor and therefore we
can use # define, # include, and # ifdef cannot use # define, # include, and # ifdef
statements. statements.

It requires that the functions with no It requires that the functions with no arguments
arguments, with the void keyword must be declared with empty parenthesis, not
with the void keyword

C has no operators such as instanceof Java adds new operators such as instanceof and
and >>>. >>>.

C adds have a break and continue Java adds labeled break and continue statements.
statements.

C has no object-oriented programming Java adds many features required for object-
features. oriented programming.

Java and C++

Java is a true object-oriented language while C++ is basically C with object-oriented


extension. That is what exactly the increment operator ++ indicates. C++ has maintained
backward compatibility with C. Is is, therefore, possible to write an old style C program and
run it successfully under C++. Java appears to be similar to C++ when we consider only the
“extensions” part of C++. However, some object -oriented features of C++ make the C++
code extremely difficult to follow and maintain.

Listed below are some major C++ features that were intentionally omitted from Java or
significantly modified.

1. Java does not support operator overloading.


2. Java does not have template classes as in C++.
3. Java does not support multiple inheritances of classes. This is accomplished using a
new feature called “Interface”.
4. Java does not support global variables. Every variable and method is declared within
classes and forms part of that class.
5. Java does not use pointers.
6. Java has replaced the destructor function with a finalize() function.
7. There are no header files in Java.

C++ Programming Java Programming

It support operator overloading. It does not support operator overloading.

It support has template classes. It does not have template classes as in C++.

It supports multiple inheritances It does not support multiple inheritances of classes.


of classes. This is accomplished using a new feature called
“Interface”.

It supports global variables. It does not support global variables. Every variable and
method is declared within classes and forms part of that
class.

It supports pointers. It does not use pointers.

It does not support destructor It has replaced the destructor function with a finalize()
function with a finalize() function. function.

There are header files in Java. There are no header files in Java.

Differences among C, C++ and Java Programming Languages: C vs C++ vs Java


 The purpose of learning a programming language is to become a better programmer
i.e. to become more effective at designing and implementing new systems and at
maintaining old ones.
 C, C++, and Java are the most popular programming languages used today at a broad
level.
 They have a pretty similar syntax for basic concepts. Most of the basic constructs like
if statements, loops, function syntax, switch case statements and concepts like
recursion are still valid.
 Many other concepts like the syntax for comments, and the idea of static class
variables, also held in both Java and C++.

Java uses the syntax of C and structure of C++ language.

Aspects C C++ Java


The developed year 1972 1979 1991
Developed By Dennis Ritchie Bjarne Stroustrup James Gosling
C(Syntax) & C++
Successor of BCPL C
(Structure)
Paradigms Procedural Object Oriented Object Oriented
Platform Dependency Dependent Dependent Independent
50 defined (goto, const
Keywords 32 63
unusable)
Datatypes: union,
Supported Supported Not Supported
structure
Pre-processor Supported (#include, Supported (#include,
Not Supported
directives #define) #define)
Header files Supported Supported Use Packages (import)
Multiple Inheritance not
Inheritance No Inheritance Supported
Supported
Operator Overloading not
Overloading No Overloading Supported
Supported
Pointers Supported Supported No Pointers
Code Translation Compiled Compiled Interpreted
Storage Allocation Uses malloc, calloc Uses new, delete uses garbage collector
Multithreading and
Not Supported Not Supported Supported
Interfaces
No Exception
Exception Handling Supported Supported
handling
Templates Not Supported Supported Not Supported
Storage class: auto,
Supported Supported Not Supported
extern
No Constructor or
Destructors Supported Not Supported
Destructor
Database Connectivity Not Supported Not Supported Supported

Object Oriented Languages -A Comparison


Java Integrates Power of Compiled Languages and Flexibility of Interpreted Languages
 We can develop two types of Java programs:
o Stand-alone applications
o Web applications (applets)
 Different ways to run a Java executable are:
Application- A stand-alone program that can be invoked from command line . A program
that has a “main” method
Applet- A program embedded in a web page , to be run when the page is browsed . A
program that contains no “main” method
 Different ways to run a Java executable are
 Different ways to run a Java executable are
 Application –Executed by the Java interpreter.
 Applet- Java enabled web browser.

1.8 JAVA and Internet


 Java is strongly associated with the internet because of the first application program is
written in Java was hot Java.
 Web browsers to run applets on the internet.
 Internet users can use Java to create applet programs & run then locally using a Java-
enabled browser such as hot Java.
 Java applets have made the internet a true extension of the storage system of the local
computer.
1.9 JAVA and WWW – Web Browsers

World Wide Web and internet

1. World Wide Web is a collection of information stored on internet computers.


2. World Wide Web is an information retrieval system designed to be used in the
internet‟s distributed environment.
3. World Wide Web contains web pages that provide both information and
controls.
4. Web pages contain HTML tags that enable us to find retrieve, manipulate and
display documents worldwide.
5. Before Java, the World Wide Web was limited to the display of still images &
texts.
6. With the help of Java WWW is capable of supporting animation graphics,
games and wide rage special effects.
1. Java communicates with a web page through a special tag called <applet>.
2. Java user sends a request for an HTML document to the remote computers net
browser.
3. The web-browser is a program that accepts a request, processes the request and
sends the required documents.
4. The HTML document is returned to that user browser.
5. The document contains the applet tag which identifies the applet. The corresponding
applet is transferred to the user computer.
6. The Java enabled browser on the user's computer interprets the byte code and
provide output.

Web Browsers

 The internet is a vast sea of information represented in many formats and stored on many
computers. a browser is a software application used to locate, retrieve and display
content on the World Wide Web, including Web pages, images, video and other files.
 As a client/server model, the browser is the client run on a computer that contacts the
Web server and requests information. The Web server sends the information back to the
Web browser which displays the results.
 The browser application retrieves or fetches code, usually written in HTML (Hypertext
Markup Language) and/or another language, from a web server, interprets this code, and
renders (displays) it as a Web page for you to view. on the computer or another Internet-
enabled device that supports a browser.

An example of Web Browsers:

 Hot Java
 Netscape Navigator
 Internet Explorer
 Google Chrome

Java Support System

Web Browser
local computer should be connected to the internet
Web Server
A program that accepts a request from a user and gives output as per the requirement.
Apache TomCat server is one of the major web servers.
Web Browser
The web browser is a software that will allow you to view web pages on the internet. it is a
program that you use to access the Internet. It reads and knows how to display and
download files that are put on servers for people to read. A program that provides the access
of WWW and runs java applets. Chrome and Firefox are two major web browsers.
HTML
HTML is short for Hypertext Markup Language. HTML is used to create electronic documents
(called pages) that are displayed on the World Wide Web. Each page contains a series of
connections to other pages called hyperlinks. Every web page you see on the Internet is
written using one version of HTML code or another.

Turning the Web into an Interactive and Application Delivery Platform


 Web is an open-ended information retrieval system designed to be used in the
Internet wide distributed system.
 It contains Web pages (created using HTML) that provide both information and
controls.
 Unlike a menu driven system--where we are guided through a particular direction
using a decision tree, the web system is open ended and we can navigate to a new
document in any direction.

Execution of Applets

Significance of downloading Applets

 Interactive WWW
 Flashy animation instead of static web pages
 Applets react to users input and dynamically change
 Display of dynamic data
 WWW with Java - more than a document publishing medium
 http://www.javasoft.com/applets/alpha/applets/StockDemo/standalone.html
Power of Java and the Web
 Deliver applications, not just information
 Eliminate porting
 Eliminate end-user installation
 Slash software distribution costs
 Reach millions of customers - instantly
Java Development Kit
 javac - The Java Compiler
 java - The Java Interpreter
 jdb- The Java Debugger
 appletviewer -Tool to run the applets
 javap - to print the Java bytecodes
 javaprof - Java profiler
 javadoc - documentation generator
 javah - creates C header files

1.9 Overview of Java- Simple JAVA Program.

 Java programming language was originally developed by Sun Microsystems which was
initiated by James Gosling and released in 1995 as core component of Sun
Microsystems' Java platform (Java 1.0 [J2SE]).
 The latest release of the Java Standard Edition is Java SE 8. With the advancement of
Java and its widespread popularity, multiple configurations were built to suit various types
of platforms. For example: J2EE for Enterprise Applications, J2ME for Mobile
Applications.
 The new J2 versions were renamed as Java SE, Java EE, and Java ME respectively.
Java is guaranteed to be Write Once, Run Anywhere.
 When we consider a Java program, it can be defined as a collection of objects that
communicate via invoking each other's methods. Let us now briefly look into what do
class, object, methods, and instance variables mean.
 Object − Objects have states and behaviors. Example: A dog has states - color, name,
breed as well as behavior such as wagging their tail, barking, eating. An object is an
instance of a class.
 Class − A class can be defined as a template/blueprint that describes the behavior/state
that the object of its type supports.
 Methods − A method is basically a behavior. A class can contain many methods. It is in
methods where the logics are written, data is manipulated and all the actions are
executed.
 Instance Variables − Each object has its unique set of instance variables. An object's
state is created by the values assigned to these instance variables.

The Basic Structure of a Simple Java Program.

You can use any editor like notepad or any Java IDE for writing java programs.

/*

This is a sample java program

Save this file as Welcome.java

*/

class Welcome

// A java program will start from here.

public static void main(String args[])

System.out.println(" Welcome to Java-Sample!!! ");

Compiling the program

After we have written our program we need to compile and run the program. For that we
need to use the compiler called javac which is provided by java.

Go to the command prompt and type the file name as shown here.

c;\>javac Welcome.java
The javac compiler will create a class file called Welcome.class that contains only bytecodes.
These bytecodes have to be interpreted by a Java Virtual Machine(JVM) that will convert the
bytecodes into machine codes. Once we successfully compiled the program, we need to run
the program in order to get the output. So this can be done by the java interpreter called java.
In the command line type as shown here.

c:\>java Welcome

So the output will be displayed as

Welcome to Java-Sample!!!

Java Tokens

 Token: A unit of user input. Tokens are separated by whitespace (spaces, tabs, new
lines).
 Example: If an input file contains the following:

23 3.14

"John Smith"

 The tokens in the input are the following, and can be interpreted as the given
types:

Token Type(s)

1. 23 int, double, String

2. 3.14 double, String

3. "John String

4. Smith" String

JVM

A Java Virtual Machine (JVM) is a virtual machine capable of executing Java


bytecode.

JVM is a piece of software that is implemented on non-virtual hardware and on standard


operating systems. A JVM provides an environment in which Java bytecode can be
executed, enabling such features as automated exception handling, which provides "root-
cause" debugging information for every software error (exception), independent of the source
code. A JVM is distributed along with a set of standard class libraries that implement the
Java application programming interface (API). Appropriate APIs bundled together form the
Java Runtime Environment (JRE).

JVMs are available for many hardware and software platforms. The use of the same
bytecode for all JVMs on all platforms allows Java to be described as a "compile once, run
anywhere" programming language, as opposed to "write once, compile anywhere", which
describes cross-platform compiled languages. Thus, the JVM is a crucial component of the
Java platform.

Java bytecode is an intermediate language which is typically compiled from Java, but it can
also be compiled from other programming languages. For example, Ada source code can be
compiled to Java bytecode and executed on a JVM.
Important University Question Bank

Section - B

1. List out the benefits of OOP.(2008,2010,2019)


2. Write a note on java virtual machine. (2007,2011,2013,2015)
3. Enumerate the various application of oops.(2014,2018,2019)
4. Discus any five java statements.(2014,2017)
5. Brief a note on vector.(2014)
6. Explain interface in java.(2014)
7. Discuss the various common java exception.(2013, 2018)
8. How you will draw a polygon? Explain.(2008,2016)
9. Describe the contribution of java to world wide web.(2009,2015)
10. Write down the need of java virtual machine.(2014,2019)
11. Write the general form of „switch‟ statement with example.(2015,2016)
12. What is a static variable? Explain.(2016,2017).

Section-C (8 MARK)
1. Discuss basic concept of oops.(2017,2010)
2. Describe the structure of java program with an example(2012)
3. Discuss basic concept of oops.(2019)
4. Describe the structure of java program with an example.(2013)
5. Briefly describe about any four OOP concepts.( 20072014,2019)
6. Explain the basic concept of oops.(2015)
7. How java differs from c and c++.(2017,2019)
8. Describe the various feature of java.(2013,2019)
9. Discuss the application and benefit of OOP. (2013,2015,2019)
10. Explain the following concept with an example(2016,2018)
i. Web browser ii. Java tokens
11. Explain the basic concept of object oriented programming.(2011,2019)
12.Write a note on java tokens. (2011,2014)

Expected Questions

1. Enumerate the various application of oops.

2. Explain the basic concept of OOPS with an example

3. Explain the basic concept of object oriented programming

4. How java differs from C and C++.

You might also like