Java Imp Question With Answers
Java Imp Question With Answers
[2021,2019,2018,2017,2016,2015,2014]
Bca expert
1] Explain the oops concepts in brief. [8marks] [2021,2019,2018,2017,2016,2015,2014]
Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data
binding, polymorphism, etc.
The programming paradigm where everything is represented as an object is known as a truly
object-oriented programming language.
Java strongly supports the concepts of oop.
There are 4 types of access specifiers :
1) public 2) private 3) protected 4)default
Message passing object communication with one another by sending and receiving
information to each other.
Object means a real-world entity such as a pen, chair, table, computer, watch, etc.
It simplifies software development and maintenance by providing some concepts:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation Bca expert
Class : class is a user defined blueprint and collection of object.
Object : any real world entity which has its own existence is know as object.
Encapsulation : the capability to hide the data.
Inheritance: inheritances is one of the most imp and use full characteristic of oops language.
inheritance is the drive new class from old class.
Polymorphism : poly means many morphism means from. multiple from are formed.
Abstraction : data abstraction is the process of representing the essential features without including
background details.
3] Define web page . Explain the characteristics of java [8m] [2019, 2018
A web page is a single hypertext document available on World Wide Web (WWW). It is composed of
HTML elements and displayed on the user's browser.
A webpage is a document written in HTML and can be viewed on any web browser. It is
contained within the web server, which can be accessed by entering the URL for that web page,
and once it is loaded, it appears on the user's web browser.
• Java is very easy to learn, and its syntax is simple, clean and easy to understand.
• According to Sun Microsystem, Java language is a simple programming language because:
Object-oriented
Platform Independent
• Java is platform independent because it is different from other languages like C.
• A platform is the hardware or software environment in which a program runs.
• Java provides a software-based platform.
Secured
• Java is best known for its security. With Java, we can develop virus-free systems. Java is secured
because
• Java language provides these securities by default. Some security can also be provided by an
application developer explicitly through SSL, JAAS, Cryptography, etc.
Bca expert
Robust
Portable
• Java is portable because it facilitates you to carry the Java bytecode to any platform. It doesn't require any
implementation.
High-performance
• Java is faster than other traditional interpreted programming languages because Java bytecode is "close" to
native code.
• It is still a little bit slower than a compiled language (e.g., C++).
• Java is an interpreted language that is why it is slower than compiled languages, e.g., C, C++, etc.
Bca expert
Distributed
Dynamic
• Java is a dynamic language. It supports the dynamic loading of classes. It means classes are loaded on
demand.
• It also supports functions from its native languages, i.e., C and C++.
Bca expert
4] How java program is compiled and interpreted ? Explain with example [8m] [2019,2018
• Java is completely portable; the same Java code will run identically on different platforms,
regardless of hardware compatibility or operating systems.
• The Java source code first compiled into a binary byte code using Java compiler, then
this byte code runs on the JVM (Java Virtual Machine), which is a software based
interpreter.
• So Java is considered as both interpreted and compiled.
• The compiled byte code allows JVM.
for example :
class Basic
{
public static void main(String args[])
{
System.out.println("Hello ");
}
}
We can execute a Java application by following two steps.
Bca expert
5] How java is different from java ,C and C++ [8m] [2021,2019,2018,2017,2016,2015,2014]
Bca expert
6] what is multithread and explain its life cycle . [8m] [2019 ,2018,
• A thread goes through various stages in its life cycle. For example, a thread is born, started, runs, and then
dies.
Bca expert
Following are the stages of the life cycle −
New − A new thread begins its life cycle in the new state. It remains in this state until the
program starts the thread. It is also referred to as a born thread.
Runnable − After a newly born thread is started, the thread becomes runnable. A thread in
this state is considered to be executing its task.
Waiting − Sometimes, a thread transitions to the waiting state while the thread waits for
another thread to perform a task. A thread transitions back to the runnable state only when
another thread signals the waiting thread to continue executing.
Timed Waiting − A runnable thread can enter the timed waiting state for a specified interval
of time. A thread in this state transitions back to the runnable state when that time interval
expires or when the event it is waiting for occurs.
Terminated (Dead) − A runnable thread enters the terminated state when it completes its
task or otherwise terminates.
Bca expert
7] list and explain java API package . [8m] [2019 ,2018,
• The java Standard Library includes hundreds of classes and methods grouped in
to several functional packages .
• Most commonly used packages are :
• Language Support Package : A collection of classes and methods required for implementing basic
basic features of java.
• Utilities Package : A collection of classes to provide utility functions such as date and time functions.
• Input/output Package : A collection of classes required for input/output manipulation.
• Networking package : A collection of classes for communicating with other computers via internet .
• AWT package : the abstract window tool kit package contains classes that implements
platform –independent graphical users interface.
• Applet package : this includes a set of classes that allows us to create java applets.
Bca expert
Thank you for watching
- Bca expert
Bca expert