0% found this document useful (0 votes)
32 views

Java Theory

The document discusses a Java exam for fourth semester students. It provides instructions for the exam and contains several questions testing students' knowledge of topics like Java keywords, OOP concepts, exception handling, threads, applets and more. Students are required to answer questions of varying formats like fill in the blanks, true/false, short questions and long descriptive questions.

Uploaded by

Avni Arora
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Java Theory

The document discusses a Java exam for fourth semester students. It provides instructions for the exam and contains several questions testing students' knowledge of topics like Java keywords, OOP concepts, exception handling, threads, applets and more. Students are required to answer questions of varying formats like fill in the blanks, true/false, short questions and long descriptive questions.

Uploaded by

Avni Arora
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

TILAK MAHARASHTRA VIDYAPEETH, PUNE

R
BACHELOR OF COMPUTER APPLICATIONS (B.C.A.)
EXAMINATION: NOVEMBER /DECEMBER 2016
FOURTH SEMESTER
Sub: Java (BCA-421)

Date 13/ 12 /2016 Total Marks: 80 Time: 2.00 pm to 5.00 pm


Instructions:
1. AlH questions are compulsory unless and otherwise stated.
2. Bold figures to the right of every question are the maxinmum marks for that question.
3. Candidates are advised to attempt questions in order.
4. Answers written illegibly are likely to be marked zero.
5. Use ofscientilic caculators, Log tables, Mollier Charts is allowed.
6. Draw neat and labelled diagrams wherever necessary.
Q.1. A) Fill in the blanks. (Solve any 5) (6)
1. The-- keyword used to instantiate any object of a class.
2. Theclass is super class
ofall subclasses
3. Event listeners are created by implementing interfaces defined i n -
package.
4. All the methods defined in any interface are - by fault.
5. The keyword indicates that a method cannot be overridden.
6. The extension of a java source file should be -
7. Java resolves the calls to the methods dynamically at run time this is called as -

B) State True/False. (Solve any 5) (5)


1. All the overloaded methods in the class have to have same signature
2. Every try block must have coresponding finally block only
3. The % operator cannot be used with integer values in Java
4. Inheritance is the process by which one object acquires the properties of
another object.
5. In Java, every value gets an initialization value at the time of declaration
depending on its data type.
6. Applets is Java must have main0 method defined in them for execution of the
program.
7. The throw keyword is used in Java program to throw an exception explicitly.

C)Answer the following. (Solve any 5) (10)


1. What Is byte code? Explain how it provides portability in Java?
2. What is an abstract class ? Explain with example
3. What is typecasting in Java?
4. Explain the scope specifies in Java such as private protected and public.
5. What are features of Java?
6. What is garbage collection in Java?

Java (BCA-421) AE /AII l/2


Q.2. Answer the following in detail. (Solve any 6) (30)
1. Explain varlous types of constructors in Java.

2. Explain OOP principles in Java.


3. Explain the use of multiple try catch blocks In exception handling in Java.
4. Explain various types of inheritance in Java.
5. Explain the class String. Explain methods of the class.
6. What are inner classes ? Give an example.
7. What are event, event source and event listener? Give an example each.

Q.3. Answer the following in detail. (30)


1. Explain different data types available in Java. What is automatic type
conversion in Java?
2. Write a program to demonstrate use of different types of constructors in Java.
3. Write a program to check if the given number is a perfect number or not.

Java (BCA-421) AE /AII 2/2


CS
TILAK MAHARASHTRA VIDYAPEETH, PUNE
BACHELOR OF COMPUTER APPLICATIONS (B.C.A)
EXAMINATION: NOVEMBER/DECEMBER- 2016
FORTH SEMESTER
Sub: Java (BCA - 431)

Date: 16/12/2016 Total Marks: 60 Time: 02.00 pm to 4.30 pm


Instructions:
1. All questions are compulsory unless and otherwise stated.
2. Bold figures to the right of every question are the maximum marks for that question.
3. Candidates are advised to attempt questions in order.
4. Answers written illegibly are likely to be marked zero.
5. Use ofscientific calculators, Log tables, Mollier Charts is allowed.
6. Drawneat and labelled diagrams wherever necessary_
Q.1. Fill in the blanks. (5)
1. To allow an element to be seen outside the curent package, but only to classes that
are the direct subclasses of your class, that element should be declared as
a) Default b) Private
c) Protected. d) Public
2. All exceptions are subclasses of the class
a) throwable b) runable

try d catch
3. A class that is inherited is called the -
a) subclass b)Super class
c) inner class d) nested class
4. The operator dynamically allocates memory for an object.
a) arithmetic ) static
c) bitwise new

5. Object is an . of class.
a) instance b) inherit
c) handle d) referencee

Q.2. State True/False. 5)


1. A class can implement more than one interface.
2. Try statements cannot be nested.
3. An inner class can be defined within any block scope.
4. The finally block will be executed even if an exception is not thrown.
5. You should include a package command as the first statement in ajava source file.

Q.3. Answer the following. (Solve any5) (10)


1. Define Thread.
What is Bytecode?
3. Define Nested class.
4. Explain indexOf0 and last IndexOf0 from string.
5. What is Exception?
6. Define Stream.

Java (BCA - 431) AE/I 1/2


Q.4. Answer the following in detail. (Solve any 6) (30)
1. Write a note on Java Virtual Machine (JVM).
2. State the difference between Overloading and Overriding along with example.
3. Explain Thread priorities along with example
4. Explain Applet lifecycle.
5. Write a java program to count vowels from given string
6. Explain Try. Catch, Finally, Throw, Throws from exceptlon along with example.
7. What is Delegation Event Model?

Q.5. Answer the following in detail. (Solve any 1) (10)


10 of Fibonacci
1. Write ajava program to create and run thread to generate t
serles.
2. Describe Event Listener interfaces and the specific methods contained in them.

Java (BCA 431) AE/lT 212


CS/CB
TILAK MAHARASHTRA VIDYAPEETH, PUNE
BACHELOR OF COMPUTER APPLICATIONS (B.C.A)
CREDIT SYSTEM/CHOICE BASED CREDIT SYSTEM
EXAMINATION: APRIL/MAY- 2017
FORTH SEMESTER
Sub: Java (BCA - 431/BCA-441)

Date: 08/05/2017 Total Marks: 60 Time: 02.00 pm to 4.30 pm


Instructions
1. All questions are compulsory unless and otherwise stated.
2. Bold tigures to thhe right of every question are the maximum marks for that question.
3. Candidates are advised to attempt questions in order.
4. Answers written illegibly are likely to be marked zero.
5. Use ofscientific calculators, Log tables, Mollier Charts is allowed.
6. Draw neat and labelled diagrams wherever necessary.
Q.1. Fill in the blanks. (5)
1. Text Area is a subclass of -
a) Text component text
c) text data d) text box

2. is the class whose objects contain strings that can be modifled after
they are created.
a) string Buffer b)buffer
c) class d) string
3. Interfaces do not have varlables.

) int bJchar
c)instance d) data
4. Multithreading is specialised form of .
a) multi data b) multilevel

c) multiple d) Multitasking
5. The method which is commonly used to wait for a thread to fînish is _
a) join0 b)stop0
) sleep0 d)isAlive0

Q.2. State True/False.


1. Checkbox is a control that used to turn an option on and off.
2. Applet contains main0 method.
Input stream is an abstract class.
System.err is object of type Inputstream.
5. The println) defined by the class PrintStream.

.3. nswer lowing. (Solve any 5) (10)


1. Define constructor.
Define package.
3. Define interface.
4. Define inheritance.
Define exception.
6. Define class.

Java (BCA- 431/BCA-441) AFM/II 1/2


Q.4. Answer the following in detail. (Solve any 6) (30)
1. Write a note on Garbage collector
2. Explain dead lock with example.
3. Discuss thread state along with diagram.
4. Explain try, catch, finally block along with example.
5. Explain static keyword along with example.
6. Explain layouts from AWT.
7. What is inner class? Explain it with example.

Q.5. Answer the following in detal. (Solve any 1 (10)


1. Write a java program to check whether given number is prime or not.

2. Write a java program to accept value from user and print its factorial

Java (BCA - 431/BCA-441) AFM/I


2/2
CS/CB
TILAK MAHARASHTRA
BACHELOR OF COMPUTER APPLICATIONS (B.C.A.)
VIDYAPEETH, PUNE
EXAMINATION: NOVEMBER/DECEMBER-2018
FORTH SEMESTER
Sub: Java (BCA- 431/BCA-441)

Date : 08/12/2018 Total Marks: 60 Time: 02.00 pm to 4.30


pm
Instructions:
.Allquestions are compulsory unless and othenvise stated.
2. Bold figures to the right of every question are the maximum marks for that question.
3. Candidates are advised to attempt questions in order.
are likely to be marked zero.
4. Answers written illegibly
5. Use ofscientific calculators, Log tables, Mollier Charts is allowed.
0 Draw neat and labelled diagrams wherever necessary
Q.1. Fill in the blanks. 5)
. Variable declared in interfaces are
implicitly
a) abstract bpublic
c)sstatic )void
2. Processes are heavyweight, whereas arelightweight.
a) Threads b) class
) Super d) object
3. The operator dynamically allocates memory for an object.
a) super b) new

c) this d) class
4. The method which is commonly used to wait for a thread to finish is
a) isAlive()0 b} run()
c) main) d) join()
5. A class that is inherited is called the
a) superclass xtend
c) subclass d) derived

Q.2. State True/False.


1. All arrays are dynamically allocated in java.
2. Constructor always have a returm type.
3. Java supports three types of comments.
4. The Exception class defines its own methods.
5. A thread once terminated cannot be resumed.

Q.3. Answer the follow ing. (Solve any 5) (10)


1. What is stream in java?
What is constructor? Explain its types also.
23.
Differentiate between Grid Layout and Border Layout.
4. Explain finally keyword.
5. What is nested class?
6. Explain this keyword in java.

Java (BCA-431/BCA-441) AGMII 1/2


Q.4. Answer the following in detail. (Solve any 6) 30)
. Explain applet life cycle.
2. Write a note on Java Virtual Machine.
3. Explain java Literals.
4. What is use of Runnable interface in threads? Explain it along with example.
5. Explain throw and throws keyword along with example.
6. Explain the FilelnputStream() and FileOutputStream() in brief.
7. Write a note on Thread Priorities along with example.

Q.5. Answer the following in detail. (Sove any 1) (10)


1. Write ajava program to read roll number, name and marks of 4 subjects for
student. Calculate total marks, percentage also find result of student.
2. Write a java program to print cube of given number. If user enters character instead
of number then it should hand le proper exception and also display error message.

Java (BCA -431/BCA-441) AGM/I


TILAK MAHARASHTRA VIDYAPEETH, PUNE
BACHELOR OF cOMPUTER APPLICATIONS (B.C.A.) CS/CB
EXAMINATION: DECEMBER - 2019
FOURTH SEMESTER
Date : 10/12/2019
Sub: Java (BCA -431/441)
Total Marks: 60 Time: 02.00 pm to 4.30 pm
Instructions:
1. All
questions are compulsory unless and otherwise stated.
2. Bold
figures
to the of right every question are the maximum marks for that
question.
3. Candidates are advised to attempt questions in order.
4. Answers written illegibly are likely to be marked zero.
5. Useof scientific calculators, Log tables, Mollier Charts is allowed.
6. Draw neat and labelled
diagrams wherever necessary.
Q.1. Fill in the blanks.
(5)
1. Ajava file with extension '.class' contains.
a) HTML tag b) java bytecode
) java source code d) None of the above
2. Which of the following is valid specifier with the main) method.
a) public b) private
protected d) default
3. What is the return type of a method that does not return any value?
a int b) float
void d) double
4. Which type of inheritance in Java programming is not
supported ?
a) multiple inheritance using classes b) multiple inheritance using
interfaces
c) multilevel inheritance d) single inheritance
5. If there is a try block, then

a)c) there should be catch block


there should be a finally block
b) there may not be any catch block
d) there may be multiple catch blocks
Q.2. State True/Fase. (5)
class must a main) method.
. Everyuses
2.
contain
Java and
interpreter compiler.
3. No method can call another method without create an object of the class to which it is
defined.
Private members of a class can be inherited by a subclass, and become protected
members in subclass.
5. Implementation of two interfaces shows as class C implements A,B

Q.3. Answer the following. (Solve any 5) (10)


1. What is a use of destroy0 method in applet.
2. Define package along with its syntax.
3. Explain final) method.
4. Join0 method why we use in thread
5. What is constructor? Explain its types.
6. What is bytecode?
Q.4. Answer the following in detail. (Solve any 6) (30)
1. Explain deadlock concept using example.
2. State the difference between File Input Stream and File Output Stream.
3. Write a short note on JVM.
4. Explain applet lifecycle.
5. What is exception? Explain try, catch, finally, throw and throws.
Java (BCA 431/BCA-441) AHM/A l/2
6. Explain static keyword along with example.
7. What is abstract class? Explain it with example.

Q.5. Answer the following in detail. (Solve any 1)


(10)
Write a. java program to accept number from user and print its factorial.
2. Write a java program to
accept 10 integer elements from user and remove dupllcate
elements from it, print it.

Java (BCA - 431/BCA-441) AHM/I 2/2


CS/CB
TILAK MAHARASHTRA VIDYAPEETH, PUNE
BACHELOR OF COMPUTER APPLICATIONS (B.C.A.)
CREDIT SYSTEMWCHOICE BASED CREDIT SYSTEM
EXAMINATION: - NOVEMBER/DECEMBER -2017
FORTH SEMESTER
Sub: Java (BCA - 431/BCA-441)

Total Marks: 60 Time: 02.00 pm to 4.30 pm


Date :04/12/2017
Instructions:
1. All questions are compulsory unless and otherwise stated.
2. Bold igures to the right of every question are the maximum marks for that question.
3. Candidates are advised to attempt questions in order
4. Answers written illegibly are likely to bemarked zero.
5. Use of scientific calculators, Log tables, Mollier Charts is allowed.
6. Draw neat andlabelled diagrams wherever necessary.
Q.1. Fill in the blanks. (5)
1. Multithreading is specialized form of
a) Multilevel b) Multitasking
le d) Multiuser
Multi
2. If method is declared i t will not return any value to the calling routine.
a) void b) int
char d) double
3. The method which is commonly used to wait for a thread to finish is
a) join0 b)sleep0
stop0 d) wait0
4. Javaimplements strings as object oftype.
state b) String
int char
. is the class whose objects contain strlngs that can be modifled after they
are created.

string b) buffer
c) string Buffer d) charAt

Q.2. State True/False. 6)


1. The println) defined by the class PrintStream.
2. A thread once terminated can be resumed.
The body of loop can be empty in java.
4. The while statement is generally used in menu selection.
5. It is not possible to include more than one statement in the initialization portion of
the for loop.

Q.3. Answer the following. (Solve any 5) (10)


1. Define thread.
2. Define stream.
3. Define class.
4. Define Object.
5. Define array.
6. Explain any four data types from java.

Java (BCA 431/BCA-441) AFMI 1/2


Q.4. Answer the following in detall. (Solve any 6) (30)
1. State difference between Overloading and Overiding along with example.
2. Explain Life cycle of Applet.
3. Explain throw and throws keyword from exception along with example.
4. Explain thread priorities along with example.
5. What is inner class? Explain it with example.
6. Write a note on byteStream class.
7. Write a note on Java Virtual Machine.

Q.5. Answer the following in detail. (Solve any 1) (10)


Write a java program to print Fibonacci series up to 50.
Write a java program to accept marks of students in 5 subjects and display
percentage of the student.

Java (BCA - 431/BCA-441) AFM/I 2/2

You might also like