II B. Tech II Semester Regular Examinations, April - 2018 Java Programming
II B. Tech II Semester Regular Examinations, April - 2018 Java Programming
com
m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A
1. a) How to use break and continue statements in java?
b) Illustrate the importance of this keyword in java.
co
c) Differentiate compile time errors and runtime errors in java.
d) What is assertion? Give example.
e) List the advantages and disadvantages of applet.
f) Differentiate GridLayout and GrodBagLayout.
PART –B
2. a) Write about the role of JVM, JAVA API in developing the platform independent java
u.
program with suitable example.
b) What are the two control structures used in java for making decisions? Explain with
an example program.
3. a) Can we use constructors with parameters? What kind of parameters can be given?
Explain with area of various geometric shapes example.
b) With an example program explain the concept of classes and nested classes in java.
nt
4. a) Write a program that shows an Employee class which contains various methods for
accessing employee’s personal information and methods for paying an employee.
b) Give the syntax of exception handling and also handle exception occurred during the
execution of divide by zero
5. a) Write a program to read and write disk file character by character using Reader and
j
Writer classes.
b) Explain thread synchronization with respect to multithreading. Why is it important?
in
7.
Explain different types Layout managers present in AWT with sample programs.
1 of 1
m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A
1. a) Write about the relationship between OOPs, OODesign and OOAnalysis.
b) Relate objects, classes and methods.
c) What is the importance of CLASSPATH.
co
d) Write about FileInputStream and FileOutputStream.
e) How applet is different from application? Explain.
f) What are the types of check boxes present in awt.
PART –B
2. a) Write a java program that inputs an integer, ‘n’ from the command line and displays
the string “1+2+3+…+n=sum” and also compute the sum.
u.
b) How to implement precedence rules and associativity in java language? Give an
example.
3. a) Design a class that represents a bank account and construct the methods to
i) Assign initial values
ii) Deposit an amount
iii) Withdraw amount after checking balance
nt
iv) Display the name and balance.
b) Do you need to use static keyword for the above bank account program? Explain.
4. a) Write a program which specify that there are two classes Rectangle and
Circle which implements the interface and find the area of rectangle and circle
b) Demonstrate nested try statements and finally statements.
j
b) Write a java program to create multiple threads. And explain the advantages of
multithreading.
6. a) Write a java code to create applet and customize it based on input parameters
b) Write different methods present in Window Listener interface.
m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A
1. a) What is data abstraction? Differentiate data and procedural abstractions.
b) Write about multidimensional arrays in java.
c) Write the similarities and differences between abstract class and interface.
co
d) Describe the lifecycle of a thread.
e) Differentiate local and remote applet.
f) Write different types of controls supported by awt.
PART –B
2. a) What are the different primitive data types in java? Give their sizes in bits. How they are
different from reference data types?
u.
b) Write a java program to illustrate the increment & decrement operators, shift operators
and ternary operator.
this statement.
6. a) Write an applet program that will take an input from the user to calculate the sum of two
integers.
b) Differentiate adopter classes and inner classes with examples.
m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A
1. a) What are the components of JAVA platform? Explain.
b) Specify the importance of garbage collection.
c) What is interface? How does it support multiple inheritance in java
co
d) Differentiate the operations suspending and stopping a thread.
e) Write about the attributes of applet tags.
f) What are the subclasses of Container class?
PART –B
2. a) How to perform type casting in java? Differentiate it from primitive type conversion
with an example program.
u.
b) Write a java program to illustrate the usage of conditional statements and looping
statements.
3. a) Discuss declaration, allocation and accessing array elements in java with matrix
multiplication example.
b) Write about command line arguments. Accept the input from keyboard to display
Fibonacci series.
nt
4. a) What is method overriding? Illustrate the concepts of method overriding and
constructor overriding.
b) With sample program explain the creation of packages. Accessing a package and
hiding classes with packages.
5. a) What is thread scheduling? How to perform this by setting priorities to threads. explain
j
6. a) Explain various states in the life cycle of an applet. And also give the syntax of each
state.
b) What are the sources of events? How to handle the events in java through event
Listeners.