---------------------------------------------------------------------------------------------
Prepared By : Uday Shah (HOD - IT)
E-Mail : rupareleducation@gmail.com
Contact No : 7600044051
:: Java One Mark Question Answer ::
#Press the follow button to get update.
1. A method implementation
of an interface must be declared as _____.
public
2. A
class can extend ____ class and can implement _____ interface.
One class , more than One.
3. When
a method can throw an Exception then it is specified by ____ keyword.
throws
4. To
create our own Exception class, we have to write ____.
Create
our own try and catch block.
5. which method cannot cause a thread to go into a blocked
state?
Sleep()
6. When
a method is used by two threads,then is should be declared by ___ keyword.
synchronize
7. When
a method has same name and same type signature as a method in super class, then this method is said to be _____.
Overridden
8. Which
method wake up the first thread that called wait() on same object?
Notify()
9. What
is vector class?
Is
collection on different data types in same
object.
10. Which interface must be implementing when using
scrollbar in Applet?
AdjustmentListener
11. Sometimes
we want to pass information into a program when we run it, which is done by
passing ___ to main().
Command
line argument.
12. ____
is used to indicate that no further alterations can be made.
final
13. When
a member is declared as a, ___ is cab be accessed before any object of its
class are created, and without reference to any object.
static
14. which method will cause
a JFrame to display?
setVisible()
15. How
do you change the current layout manager for a container which method is
used?
setLayout
method.
16. The
(0,0) co-ordinates of Applet window is located at____
At
the upper-left corner of the applet,
17. Syntax
of replace() of string class is ___
Str.replace(str1,str2)
18. Which
methods is used to delete more then one character from string?
deleteCharAt()
19. The
____ contains all the graphics methods, all then windowing methods, and the
components needed to create user interfaces.
Java.awt
package
20. Syntax
of drawstring in Applet.
g.drawString(int
x,int y,String)
21. ____ are instructions
that are not for any specific cpu. instead they are designed to be interpreted
by a JVM.
Byte
Codes
22. The
advantage of such a design is that the ____ class specifies what functionality
is provided but not how that functionality is provided.
Final
23. To
create an array of 7 integers which statement to write?
int
a[]=new int [7];
24. When
an object is no longer referenced by any variable, it then becomes eligible for ________.
Garbage
collection.
25. What
is the output of this program?
Compile time
error.
26. ____
is shared by all objects of its class and thus relates to the class itself.
Global
variable.
27. Which
method is used to perform some actions when the object is to be destroyed?
Finalize()
28. When
an array element is accessed beyond the array size,___ exception is thrown.
ArrayIntexOutOfBoundsException
29. ____
occurs when a class declares a method that has the same type signature as a
method declared by one of its super classes.
Method
Overriding.
30. What is class?
Class
is a collection of different method and variable.
31. Syntax
of delete() method is StringBuffer class.
Delete(char
ch)
32. What
is the output of this program?
Compile
time error.
33. To
find the value associated with the specified key ___ method is used.
getValue(object
key)
34. If another thread
attempts to execute a ____ static method for that same class,the JVM
automatically causes that thread to wait until the first thread relinquishes
the lock.
Synchronized
35. AdjestmentListener
interface defines the ___ method that is invoked when an adjustment event
occurs.
adjustmentValueChanged(AdjustmentEvent
e)
36. Write
constructor for JFrame.
JFrame(String
title)
37. The
___ class allows you to write programs that can seek to any location in a file
read or write data at that point.
Random
access file.
38. Which
layout manager allows placing components one after another as well one on top
of another?
Card
Layout
39. In
event handling, sometimes we need only one or some methods of the interface in
that case ___ are the best solution.
Adapter
class
40 The
____ method is called when your applet is to be terminated and needs to be
removed from the memory.
Destroy()
41. Java is an ______ language.
Object
oriented, multi thread programming
42. Java was developed by.
Sun
Microsystems
43. Java is designed to the basis of
_______ keys.
powerful
programming language
44. Java development environment
there are ______ parts.
Java
Interpreter
45. The Compiler _________.
Execute
java program
46. The Interpreter ________.
Generates
Byte Code
47. Java enables the creations of
______ programs.
cross-platform, right-platform
48. RMI Stand for ____________.
Remote
Method Invocation
49. In java de-allocations
happens_____.
Automatically
50. Class inherits from the ______.
Object
51. Object class is the ________ of all the class
in the java class hierarchy.
Subclass
52. 12. How many types of
method declare in java?
3
53. Overloading Method demonstrate the concept of
________
Polymorphism
54. What is the argument type of Program's main()
method
String Array
55. What is the primitive data type.
Byte,Short
56. Which cast must be used to convert a large
value into smaller one.
Explicit
57. You would use the ______ operator to create a
single in stance of a named
class.
new
58. Which of the following classes is used
to perform basis consol I/O.
System
59. ____ is the processing of calling the f
unction from the function itself.
Recursion
60. ______ applies only when inheritance is
involved.
Protected
#Press the follow button to get update.
:: Best Of Luck ::
Please share and comment it. Thank you....