Which of the following cannot be used for a variable name is Java?
Official theoretical question paper for Object Oriented Programming (PCC-CS503) conducted by Maulana Abul Kalam Azad University of Technology. All questions from Groups A, B, and C are reproduced below with marks weightings.
Which of the following cannot be used for a variable name is Java?
Which one of the following is a valid declaration of an Applet?
What is the range of the char type?
What is the output of this program? ```java class area { public static void main(String args[]) { double r, pi, a; r = 9.8; pi = 3.14; a = pi * r * r; System.out.println(a); } } ```
What is an example of polymorphism?
Exception is defined in which package?
The relation between classes can be represented by
The import statement is always
Method overloading occurs only when
Which of the following values can a Boolean variable contain?
What is byte code? What does the JVM do? Why is Java called compiled-interpreted language?
Discuss Applet life-cycle indicating the functions.
a) What is command line argument? b) Compare string and stringBuffer class.
What is the base class of Error and Exception? Differentiate between throw and throws.
a) What is mutable strings? b) What are the benefits of organizing classes into package? c) How can you create your own package and add classes in that? Explain with an example. d) Explain with the help of an example, how java gets benefited by using interface.
Write short notes on any three of the following: a) Wrapper class b) Meta class c) Abstraction d) Polymorphism.
a) Write a program running a main thread and a child thread simultaneously. b) List various attributes of Applet tag used in HTML. c) Write a Java program that uses the draw polygon () method of Graphics class to draw a triangle with End points (25, 30), (75, 80) and (50, 50).
a) Why does Java have two ways to create child threads (by extending thread or implementing Runnable) and which approach is better? b) Define an exception called "NotEqualException" that is thrown when a float value is not equal to 3.14. Write a program that uses that user defined exception. c) Write a multithreading program to generate the square roots to the first 30 natural numbers using Runnable interface. d) What do you mean by Synchronization? Why do we need it?
a) How is applet different from frame and page? b) How are threads made to communicate with each other? Explain with example. c) Explain any three events with suitable example.