Java programming using Linux-Sem5-Sept-2019
|
|
Name ……………………………
Roll
No ……………………….
|
SAINTGITS COLLEGE OF APPLIED SCIENCES
MODEL INTERNAL ASSESSMENT EXAMINATION, SEPTEMBER2019
Department of BCA, Semester 5
JAVA
PROGRAMMING USING LINUX
Total : 80 marks Time:3Hours
Section
A
Answer any 10 questions.
Each question carries 2 marks.
1.What is byte code?
-Compiled java source code
Intermediate code
Platform neutral.
diagram
2.What is jvm?
Java Virtual Machine.exists in computer memory.does all
major functions like a computer
3.What is a constructor?
constructor is
a special method that is used to initialize a newly created object and is
called just after the memory is allocated for the object. It can be used to
initialize the objects to desired values or default values at the time of object
creation..Class name and method will be same.
4.What is dynamic method dispatch?
Runtime polymorphism.- Dynamic method dispatch is
a mechanism by which a call to an overridden method is
resolved at runtime. This is how java implements runtime polymorphism.
When an overridden method is called by a reference, java determines
which version of that method to execute based on the type of
object it refer to.
5.What is polymorphism?
Oops concept
Ability to take more than one form
6.What is an object?
A Java object is a combination of
data and procedures working on the available data. An object has
a state and behavior. The state of an object is stored in
fields (variables), while methods (functions) display the object's behavior. Objects are
created from templates known as classes
7.Give the method used in interface Action Listener?
Action Permormed(Action Event ae)
8.Give any 2 methods used in Graphics class with syntax.
void drawLine(int xBegin, int yBegin, int xEnd, int yEnd)
void drawRect(int x, int y, int w, int h) void fillRect(int x, int y, int w, int h)
9.Give the structure of java program.
Explain with diagram.
10.What is delegation event model?
In the delegation
event model, a class designated as an event source
generates an event and sends it to one or more listeners. ...
This means that a particular event is processed only by a
specific listener
11.Name the methods used in applet.
Init()
Paint()
Start()
Stop()
12.What is jdbc?
Java Database Connectivity (JDBC)
is an application programming interface (API) for the programming language
Java, which defines how a client may access a database. ... It provides methods
to query and update data in a database, and is oriented towards relational
databases
Section B
Answer any six of the following. Each
question carries 5 marks.
13.Write
the features of Java.
·
Platform Independent.
...
·
Simple. ...
·
Secure. ...
·
Architecture-neutral.
...
·
Portable. ...
·
Robust. ...
·
Multithreaded
14.Explain
operators in java
·
Arithmetic Operators.
·
Unary Arithmetic Operators.
·
Relational Operators.
·
Logical Operators.
·
Bitwise Operators.
·
Assignment Operators.
·
Conditional Operator.
15.With
an example write about packages in java.
A package as the name suggests is a pack(group) of
classes, interfaces and other packages. In java we
use packages to organize our classes and interfaces. We have
two types of packages in Java: built-in packages and
the packages we can create (also known as user defined package).
Give Example
16.Write
about super keyword in java.
Super Keyword in Java. The super keyword in Java is
a reference variable which is used to refer immediate parent class object.
Whenever you create the instance of subclass, an instance of parent class is
created implicitly which is referred by super reference
variable
- super
can be used to refer immediate parent class instance variable.
- super
can be used to invoke immediate parent class method.
- super()
can be used to invoke immediate parent class constructor.
17.Explain
interfaces in java.
An interface
in java is a blueprint of a class. It has static constants
and abstract methods.
The interface in Java is a
mechanism to achieve abstraction. There can be only abstract
methods in the Java interface, not method body. It is used to achieve
abstraction and multiple inheritance in Java.
Syntax
and example
18.Differeniate
between final, finalize and finally?
·
The final keyword can be used with class method
and variable. A final class cannot be instantiated, a final method cannot be
overridden and a final variable cannot be reassigned.
·
The finally keyword is used to create a block of
code that follows a try block. A finally block of code always executes, whether
or not an exception has occurred. Using a finally block allows you to run any
cleanup-type statements that you just wish to execute, despite what happens
within the protected code.
·
The finalize() method is used just before object
is destroyed and can be called just prior to object creation
19.Write
about any 2 components of swing with example
Jtextarea
J
Label
Give
syntax and constructor
20.Explain
applet life cylce?
- Born
state
- Running
state
- Idle
state
- Dead
or destroyed.
21.Explain
different jdbc drivers?
|
Section C.
Answer any two of the
following.
Each question carries
15 marks
22.Explain the
different control statements in java.
Selection
statements types and example
Iteration
statements types and example
Jump statements
types and example
23.Write about
exception handling in java.
Exception
–definition
Try..
Catch
Throw
Throws
Finally
24.Write about
multithreading with examples.
Write lifecycle
Multithreading definition
Creation of
threads
25.Explain
inheritance with suitable examples
Inheritance
definition types.give examples
Simple
inheritance
Multilevel
inheritance
Hierarchial
inheriatnce
(15x2=30)
_____________________
Comments
Post a Comment