Correct Answer:
Subscript
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Return statement.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Flowchart
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Final
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JSON
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Negative
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Instance
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Local
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Do-nothing.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Enum.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Diamond.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
3.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
-2
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Private access
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Alphabetical
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Data type
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Constructor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ImageIcon.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Sequence
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Primitive variable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Single equal sign
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Use the private modifier on the constructor.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Constructors
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Standard output device
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Constructor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Iterable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Three
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Multiple inheritance
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
High-level
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Machine code
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Is a special value that cannot be mistaken as a member of the list
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An instance method
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Commas
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Boolean expression
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Parentheses
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
\n
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Get
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Return type
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Nested if statement
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Lexicographical
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Synchronized
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Error, exception
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
If(time.equals(money)){}
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Generics
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Every class must explicitly define a constructor without parameters.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
BigDecimal
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Try-with-resources
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java.util.HashMap
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Throwable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Hello
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ArrayList
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Inside the method
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Pass by value
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
When you want your method to be available independently of class instances
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
+
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Integer.parseInt("21")
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Final
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Private
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
String a -> false;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
This.getClass().getSimpleName(); this.getClass().getDeclaredMethods()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Static factory method; singleton; strategy pattern
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Set object to null and call System.gc()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Is-a
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Deciding if two instances of a class are equal
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Consumer, Predicate, Supplier
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Int[] numbers = new int[10];
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Classes related by inheritance are tightly coupled to each other.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
%
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Double pi = 3.141;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
You don't have to decide the size of an ArrayList when you first make it.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Implements
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Add a static import.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Super
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Compiled; executing
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The object you are using has not been instantiated.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It will never be cached by the CPU.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Final
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
String1.equals(string2)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Constructor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
"nifty" instanceof String
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Objects; actions
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An anonymous class does not require a zero-argument constructor.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Main
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Int0 % 5 == 0
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
LocalDate.now()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Private
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Names.sort(List.DESCENDING)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Negative number
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
For (Pencil pencil : pencilCase) {}
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
I2 && b1
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Method overriding
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Raw
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Arguments
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Anonymous
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
2
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A logic error
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Closed-ended questions
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Sleep(long milliseconds)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Object-oriented languages
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Pause
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Source.setOnAction(handler)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Syntax errors
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No exceptions
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Base
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
That a variable of supertype can refer to a subtype object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Double
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Int
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Public data fields
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
1
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Multiple inheritance
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A data field/the aggregating class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Private
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Array_slice()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Set methods
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
%d.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Interface
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Fusion
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Member
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Runtime
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Searching
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Priming read
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Counter-controlled
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Superclass.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Void
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Parentheses.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
AND
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Single-row
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<=
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Output
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
256
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Local
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Substring
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An ArrayList
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Variable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
!=
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The String method length()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UPDATE
DELETE
INSERT
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
X.clear()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The arguments to the method
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
(insertion point + 1)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Exception
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An argument
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Bytecode interpreter
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A list
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Static
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Clause
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Initialized before their values are used in expression
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Null
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Methods
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Get method
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Exception
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ShowMessageDialog
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
System.exit(0);
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ToString()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Mutator
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Accessor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Causes overflow
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Fault-tolerant
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
GetSource()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Reference
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A local variable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ParseDouble
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
AppendText
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Checked exceptions
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Sorting
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Iterator
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Void Method
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Throw
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java interpreter
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Break
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Reference of the array
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Curly braces
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
May
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The program must discard white space characters at the beginning of the input before calling the next method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Reference of the object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
First
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Composition
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A reference to the object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Thrown
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The starting memory address of
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Main
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Final
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Overrides
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ASCII code
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Formal Parameters
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Qualify
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Double d = i
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
X=(float)d
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
+
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
*
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
If
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both a and b
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Has-a
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Inheritence
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Primary read
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ArrayList
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Public Boolean Strings
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Value
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Constructor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Constructor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Variables
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Is executed
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
S.trim()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
(ch >= 'A' && ch <= 'Z')
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Abstract
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Declaration
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The current time in milliseconds since midnight, January 1, 1970 GMT (the Unix time)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Format
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ButtonBase
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Signature
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A Boolean literal
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Event controlled
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Default
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
EventHandler
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Public void handle(ActionEvent e)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Two bytes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
External
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
System.currentTimeMillis() / 1000 / 60 % 60
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java123
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Calendar.get(Calendar.WEEK_OF_YEAR)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Calendar.getActualMaximum(Calendar.DAY_OF_MONTH
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Calendar.get(Calendar.MONTH)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Commas (,)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Bc
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
S1.compareTo(s2
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Polymorphism
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Super
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
P.getChildren().addAll(node1, node2)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
P.setOnMouseClicked(handler);
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
New BigDecimal("454.45")
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Different methods in a class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Is unique to each thread
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Loop
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Integer division
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Data integrity
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JAVA
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Interface
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Static
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
27.0
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Color
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
String
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Assignment statements
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Public static void main(String[] args)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Static
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A private instance variable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Fields; methods
Note: This Question is unanswered, help us to find answer for this one
public class Test{
private int qusNo = 100;
}
What can directly access and change the value of the variable qusNo?
Correct Answer:
Only the Test class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
32
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A local variable of type float defaults to 0.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
javac App.java java App.java
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The method in the child class must have the same signature as the method in the parent class.
The method in the child class must be less accessible than the method in the parent class.
The method in the child class may not throw a checked exception that is new or braoder than the class of any exception thrown in the parent class method.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
3
Note: This Question is unanswered, help us to find answer for this one
Which statement is true about the given code? public class Test78 { public static void main(String[] args) throws Exception { new JBean().setHeight(1).setWidth(2).setDepth(3).setDensity(9); } } class JBean { private int height, width, depth, density; public JBean setHeight (int h) { this.height = h; return this; } public JBean setWidth (int w) { this.width = w; return this; } public JBean setDepth (int d) { this.depth = d; return this; } public JBean setDensity (int d) { this.density = d; return this; } }
Correct Answer:
The code compiles and runs.
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given code? public class Test15 { public static void main(String[] args) { VO a = new VO(2); VO b = new VO(3); swapONE(a, b); print(a, b); swapTWO(a, b); print(a, b); } private static void print(VO a, VO b) { System.out.print(a.toString() + b.toString()); } public static void swapONE(VO a, VO b) { VO tmp = a; a = b; b = tmp; } public static void swapTWO(VO a, VO b) { int tmp = a.x; a.x = b.x; b.x = tmp; } } class VO { public int x; public VO(int x) { this.x = x; } public String toString() { return String.valueOf(x); } }
Correct Answer:
2332
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
primitives
enum types
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following are true? (Choose all that apply) public class UpWork { public
staic void main(String[] args) { UpWorkupw = new UpWork(); }}
Correct Answer:
Upwork is a class. upw is a reference to an object.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Neither entity class nor methods can be marked as final in JPA.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Method must return void or implementation of Future
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An instance variable of type boolean defaults to false.
An instance variable of type int defaults to 0.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What would be the result of the following code? public class Quest { int i=0; public static void main(String argv[]) { } Quest() { top: while(i <2) { System.out.println(i); i++; continue top; } } }
Correct Answer:
The code will not compile as a target label cannot appear before the corresponding continue or break statement.
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program? public class Test96 { public static void main(String[] args) { int[] a = new int[2]; System.out.println(a.length); } }
Correct Answer:
2
Note: This Question is unanswered, help us to find answer for this one
Given the following class, which of the following is true? (Choose all that apply) 1: public class UpWork { 2: 3: public void freelancer(boolean time) { 4: 5: if (time) { 6: 7: } 8: System.out.println(result); 9: 10: } 11: }
Correct Answer:
If String result = "job"; is inserted on line 2, the code will compile.
If String result = "job"; is inserted on line 4, the code will compile.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
public interface Foo { int k = 4; /* Line 3 */ } Which three piece of codes are equivalent to line 3? 1, final int k = 4; public int k = 4; static int k = 4; abstract int k = 4; volatile int k = 4; protected int k = 4;
Correct Answer:
3, 4 and 5
Note: This Question is unanswered, help us to find answer for this one
Which one of the following will declare an array and initialize it with five numbers?
Correct Answer:
int [] a = {23,22,21,20,19};
Note: This Question is unanswered, help us to find answer for this one
What is the purpose of a class constructor?
Correct Answer:
To make objects initially have certain values when they are instantiated
Note: This Question is unanswered, help us to find answer for this one
Which of the following snippets of code can be used to instantiate an object?
Correct Answer:
Class A = new AClass();
Note: This Question is unanswered, help us to find answer for this one
What will be the value of a? let a = -1 ? 'foo' ? null : -1 : 1;
Correct Answer:
null
Note: This Question is unanswered, help us to find answer for this one
Which statement is true for below code:- String s1 = "UpWork"; String s2 = "UpWork"; StringBuilder sb1 = new StringBuilder(); sb1.append("Up").append("Work"); System.out.println(s1 == s2); System.out.println(s1.equals(s2)); System.out.println(sb1.toString() == s1); System.out.println(sb1.toString().equals(s1));
Correct Answer:
true is printed out exactly three times.
Note: This Question is unanswered, help us to find answer for this one
Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
Correct Answer:
java.lang.StringBuffer
Note: This Question is unanswered, help us to find answer for this one
Which statement is true about the "switch" construct?
Correct Answer:
The "default" statement will execute, if no matching "case" statement is found.
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the valid declaration of a method within an interface definition?
Correct Answer:
public double methoda();
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a valid keyword in java?
Correct Answer:
interface
Note: This Question is unanswered, help us to find answer for this one
Which keyword prevents a class from being extended by another class?
Correct Answer:
final
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the best way to compare the values stored in two objects?
Correct Answer:
Overriding equals() Method
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a short circuit operator? (Check all that apply)
Correct Answer:
&&
||
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is TypeError?
Correct Answer:
It's a human-friendly string with description about unexpected variable type used
It's an object with message parameter
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a valid declaration of a String?
Correct Answer:
String s1 = null;
Note: This Question is unanswered, help us to find answer for this one
Which of the following are correct Constructor Rules?
Correct Answer:
The first statement of every constructor is a call to another constructor within the class using this(), or a call to a constructor in the direct parent class using super().
Note: This Question is unanswered, help us to find answer for this one
Which is a reserved word in the Java programming language?
Correct Answer:
native
Note: This Question is unanswered, help us to find answer for this one
Which of the following is used to find out that a thread is still running?
Correct Answer:
isAlive()
Note: This Question is unanswered, help us to find answer for this one
Consider below code: class Ex1{ public static void main(String args[]){ int x = 10; int y = new Ex1().change(x); System.out.print(x+y); } int change(int x){ x=12; return x; } } What will be the output?
Correct Answer:
22
Note: This Question is unanswered, help us to find answer for this one
What do JS classes support?
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Which assignments are valid, if put instead of /* [placeholder] */ in the given code? (check any that apply)
public class Test114 {
public static void main(String[] args) {
class A { class A2{} }
class A2 extends A {}
/* [placeholder] */
}
}
Correct Answer:
A a = new A2();
A.A2 a = new A().new A2();
A.A2 a = new A2().new A2();
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following are valid ways to define a thread in Java?
Correct Answer:
Create a subclass of java.lang.Thread class
Create a class that implements java.lang.Runnable
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Select all correct statements:
Correct Answer:
Empty Java files compile without errors.
Importing java.lang package is not mandatory.
A Java source file that contains only import statements compiles without errors.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which statement is false?
Correct Answer:
When a subclass method with the same name and argument as its superclass is called, the superclass method is automatically called.
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the below code? class App{ public static void main(String[] args){ try{ System.out.print("1"); throw new Exception(); System.out.print("2"); } catch(Exception ex){ System.out.print("3"); throw ex; } } }
Correct Answer:
Code will not compile
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following program? class Upwork { public static void main(String args[]) { try { System.out.println("Hello World"); } finally { System.out.println("Finally executing"); } } }
Correct Answer:
Hello World Finally executing
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program? public class Test71 { public static void main(String[] args) { System.out.println(new Child().toString()); } } class Parent { public String toString() { return this.getClass().getName(); } } class Child extends Parent {}
Correct Answer:
Child
Note: This Question is unanswered, help us to find answer for this one
Which statement is true about the given program? public class Test25 { public static void main(String[] args) { final byte a = 20; final byte b = 4; final byte c = a + b; System.out.println(c); } }
Correct Answer:
It compiles, runs, outputs 24 and exits.
Note: This Question is unanswered, help us to find answer for this one
What will be the output when the following code is compiled and run? public class Test { public static void main(String args[]) { int i; i = 3; System.out.println((int) i * 2.5 / 3.0); } }
Correct Answer:
The code will print 2.5.
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given console application? public class Main { public static void main(String[] args) { final int X = 9; int[][] a = {{5, 4, 3}, {9, 7, 2}, {1, 6, 8}}; for (int i=0; i<3; i++) { for (int j=0; j<3; j++) { if (a[i][j] == X) break; System.out.print(a[i][j] + " "); } } } }
Correct Answer:
5 4 3 1 6 8
Note: This Question is unanswered, help us to find answer for this one
Which of the following keyword is used for manually throwing an exception?
Correct Answer:
throw
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are true? (Choose all that apply)
Correct Answer:
An array has a fixed size.
An array allows multiple dimensions.
An array is ordered.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the output of the following program? class Upwork{ public static void main(String args[]) { int x , y; x = 10; x++; --x; y = x++; System.out.println(x + " " + y); } }
Correct Answer:
11 10
Note: This Question is unanswered, help us to find answer for this one
Which of the following are valid java identifiers? (check any that apply)
A. Up$Work
B. _UpWork
C. true
D. Up.Work
E. Public
F. 1980_s
Correct Answer:
Up$Work
_UpWork
Public
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
We have a thread defined and running, which method is used to terminate its execution?
Correct Answer:
interrupt
Note: This Question is unanswered, help us to find answer for this one
Which three are valid declarations of a float? float f1 = -343; float f2 = 3.14; float f3 = 0x12345; float f4 = 42e7; float f5 = 2001.0D; float f6 = 2.81F;
Correct Answer:
2, 4, 6
Note: This Question is unanswered, help us to find answer for this one
Which code will terminate the execution of a java program? (check any that apply)
Correct Answer:
System.exit(0);
Runtime.getRuntime().exit(0);
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which one of these lists contains only Java programming language keywords?
Correct Answer:
goto, instanceof, native, finally, default, throws
Note: This Question is unanswered, help us to find answer for this one
Which of the following are valid for an interface in Java?
Correct Answer:
Interfaces cannot be instantiated directly.
An interface is not required to have any methods.
An interface may not be marked as final.
All top-level interfaces are assumed to have public or default access, and they must include the abstract modifier in their definition.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a method of a wrapper Integer for obtaining hash code for the invoking object?
Correct Answer:
int hashCode()
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program? public class Test122 { public static void main(String[] args) { int i = 0; i = i++; i = ++i; i = i++; System.out.println(i); } }
Correct Answer:
1
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following program? class Upwork { public static void main(String [] args) { int x = 0x80000000; System.out.print(x + " and "); x = x >>> 31; System.out.println(x); } }
Correct Answer:
-2147483648 and 1
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following code? StringBuilder sb = new StringBuilder("UpWork"); sb.insert(6,"-"); sb.insert(0,"-"); sb.insert(4,"-"); System.out.println(sb);
Correct Answer:
-UpW-ork-
Note: This Question is unanswered, help us to find answer for this one
Which of the following statement is true about an anonymous inner class?
Correct Answer:
It can extend exactly one class or can implement exactly one interface
Note: This Question is unanswered, help us to find answer for this one
Which interface does java.util.Hashtable implement?
Correct Answer:
java.util.Map
Note: This Question is unanswered, help us to find answer for this one
Which of the following cannot directly cause a thread to stop executing?
Correct Answer:
Calling notify() method on an object.
Note: This Question is unanswered, help us to find answer for this one
Which of the following statement is an incorrect statement?
Correct Answer:
StringBuffer calss is used to store string in a buffer for later use.
Note: This Question is unanswered, help us to find answer for this one
You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
Correct Answer:
Protected
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements regarding abstract classes are true? (check any that apply)
Correct Answer:
All methods declared in an abstract class must be abstract.
Any subclass (abstract or concrete class) of an abstract class must implement all the methods declared in the parent abstract class.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Is it possible to make entity as read only ?
Correct Answer:
By making @org.hibernate.annotations.Entity(mutable = false).
Declare your fields as "protected" and provide only public getter.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following code:- List<String>upWork = new ArrayList<>(); upWork.add("jobs"); upWork.add(1, "freelancers"); upWork.add(0, "projects"); upWork.add(1, "earnings"); System.out.println(upWork);
Correct Answer:
["projects", "earnings", "jobs", "freelancers"]
Note: This Question is unanswered, help us to find answer for this one
Which annotation helps to define the table where entity will be stored?
Correct Answer:
@Table
Note: This Question is unanswered, help us to find answer for this one
Assuming the tag library is in place and the tag handler is correct, which of the following is the correct way to use a custom tag in a JSP page?
Correct Answer:
<yourLibrary:whatColorlslt color=»red»/>
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following program? class Upwork { public static void main(String args[]) { try { return; } finally { System.out.println("Finally"); } } }
Correct Answer:
Finally
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following code? String string = "UpWork"; System.out.println(string.indexOf("o",5))?
Correct Answer:
"-1"
Note: This Question is unanswered, help us to find answer for this one
What is required for Message-Driven Bean?
Correct Answer:
@MessageDriven annotation must be used
Class must be public
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following are known as runtime exceptions?
Correct Answer:
ArithmeticException
ClassCastException
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which three are valid declarations of a char? char c1 = 064770; char c2 = 'face'; char c3 = 0xbeef; char c4 = \u0022; char c5 = '\iface'; char c6 = '\uface';
Correct Answer:
1, 3, 6
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program? public class Test115 { { System.out.print("_init"); } static { System.out.print("_static"); } public static void main(String[] args) { System.out.print("_main"); } }
Correct Answer:
_static_main
Note: This Question is unanswered, help us to find answer for this one
Which of the following programs will compile, run as a console application, and print the corresponding text to System.out?
Correct Answer:
public class Test79a { public static void main(String[] args) throws Exception { System.out.println("Hello, 79a!"); } }
public class Test79b { final public static void main(String[] args) throws Exception { System.out.println("Hello, 79b!"); } }
public class Test79c { public static void main(String[] arguments) throws Exception { System.out.println("Hello, 79c!"); } }
public class Test79d { public static void main(String... args) throws Exception { System.out.println("Hello, 79d!"); } }
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which will legally declare, construct, and initialize an array?
Correct Answer:
int myList [] = {4, 3, 7};
Note: This Question is unanswered, help us to find answer for this one
A method can be defined as native to: (choose all that apply)
Correct Answer:
Get to access hardware that Java does not know about.
Write optimized code for performance in a language such as C/C++.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following code? class ExceptionTest{ public static void main(String[] args){ try{ System.out.print("1"); throw new Exception(); } catch(Exception ex){ System.out.print("2"); } finally{ System.out.print("3"); } } }
Correct Answer:
123
Note: This Question is unanswered, help us to find answer for this one
Which of the following are ignored by serialization? (Choose all that apply)
Correct Answer:
Static fields
Transient fields
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the output of the following program? class Upwork { public static void main(String args[]) { try { int a[]={1,2,3,4,5}; for(int i=0;i<7;i++) System.out.println(a[i]); } catch(ArrayIndexOutOfBoundsException e) { System.out.println("0"); } } }
Correct Answer:
123450
Note: This Question is unanswered, help us to find answer for this one
Which method contains the body of the thread?
Correct Answer:
run()
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following code? int three = 3; String four = "4"; System.out.println(1 + 2 + three + four);
Correct Answer:
"64"
Note: This Question is unanswered, help us to find answer for this one
Which of these packages contain all the Java's built in exceptions?
Correct Answer:
java.lang
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods waits for the thread to terminate?
Correct Answer:
join()
Note: This Question is unanswered, help us to find answer for this one
What is the output of the following program?
Class Upwork{
Public static void main(string args[])
{
Byte x = 64;
Int I;
Byte y;
i = x << 2
y = (byte) (x << 2)
system.out.print(I + “” + y);
}
}
Correct Answer:
256 0
Note: This Question is unanswered, help us to find answer for this one
Which type(s) cannot be used as generics?
Correct Answer:
primitives
Note: This Question is unanswered, help us to find answer for this one
What is the purpose of EL(Expression Language) in Java Web Application?
Correct Answer:
Dynamically set/get JavaBean component data
Invoke JavaBean methods
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
compilation fails
Note: This Question is unanswered, help us to find answer for this one
Which of the following are true?
Correct Answer:
The following classes compile. public class UpWork { public UpWork(int
freelancers) { } } public class Developer extends UpWork { }
Note: This Question is unanswered, help us to find answer for this one
What is the purpose java.exe?
Correct Answer:
Compile .java files and run them
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
sleep
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
HashMap
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements regarding Java classes is true?
Correct Answer:
A class provides the behavior and structure to create objects.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Sam class is encapsulated.
Note: This Question is unanswered, help us to find answer for this one
Which of the following will compile without any error?
Correct Answer:
public abstract class UpWork { }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@Temporal
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No compilation error
Note: This Question is unanswered, help us to find answer for this one
Is it possible to get mapping information from parent class that entity extends?
Correct Answer:
Yes, @MappedSuperclass annotation is used.
Note: This Question is unanswered, help us to find answer for this one
What kinds of properties can a JavaBean have?
Correct Answer:
indexed properties
bound properties
constrained properties
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
shape1.show(); // Line 1 - Square Class Method Call shape2.show(); // Line 2 -Square Class Method Call
Note: This Question is unanswered, help us to find answer for this one
Which tool has interface to trigger managed beans?
Correct Answer:
java.exe
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It does not compile (compiler error).
Note: This Question is unanswered, help us to find answer for this one
What is the difference between a try-catch block and a try-catch-finally block?
Correct Answer:
try-catch contains code to execute if an error occurs or not, while try-catch-finally works the same way as try-catch block with the addition of a set of code that willexecute whether an error occurs or not.
Note: This Question is unanswered, help us to find answer for this one
Which is the best place to store business logic and look of the page?
Correct Answer:
Servlet must contain both display logic and business logic.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
* (must fix if (a[i]>a[k]) to if (a[i]<a[k]))
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Check if the ArrayList already contains the same string using the contains()
method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is a class method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The output cannot be predicted.
Note: This Question is unanswered, help us to find answer for this one
Which is the correct way to make the Jframevisiable always on top of other windows ?
Correct Answer:
Jframe.setAlwaysOnTop(true);
Note: This Question is unanswered, help us to find answer for this one
Which is a proper way to declare and throw exception of class XYException?
Correct Answer:
class XYException extends Exception {} ... throw new XYException();
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It returns a compile time error.
Note: This Question is unanswered, help us to find answer for this one
What is the numerical range of a char?
Correct Answer:
0 to 65535
Note: This Question is unanswered, help us to find answer for this one
Is it possible to execute different threads in a user defined sequence in Java?
Correct Answer:
It's possible using the "notify" method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
O(2^n)
Note: This Question is unanswered, help us to find answer for this one
Can one class in java extend multiple classes?
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Which is the correct method to add button listener.
Correct Answer:
jButton1.addActionListener(new java.awt.event.ActionListener() { public void
actionPerformed(java.awt.event.ActionEventevt) { } });
Note: This Question is unanswered, help us to find answer for this one
Which annotation makes a basic class persistent?
Correct Answer:
@Entity
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public class Developer extends Freelancer { // Methods and variables defined here }
Note: This Question is unanswered, help us to find answer for this one
Which of these is a process of converting a primitive data type into object?
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program? public class Test109 { public static void main(String[] args) { System.out.println( 10/3 > 3 ? "MORE" : 10/4 < 3 ? "LESS" : "MORE" ); } }
Correct Answer:
LESS
Note: This Question is unanswered, help us to find answer for this one
Which of the following are among the rules for defining abstract methods?
Correct Answer:
An abstract method must not provide a method body/implementation in the abstract class for which it is declared.
Note: This Question is unanswered, help us to find answer for this one
Which is the valid declarations within an interface definition?
Correct Answer:
public double methoda();
Note: This Question is unanswered, help us to find answer for this one
Which method is used to wait for thread to fully complete its execution?
Correct Answer:
join
Note: This Question is unanswered, help us to find answer for this one
What allows the programmer to destroy an object x?
Correct Answer:
Only the garbage collection system can destroy an object
Note: This Question is unanswered, help us to find answer for this one
Which statement is true about a static nested class?
Correct Answer:
It does not have access to non static members of the enclosing class.
Note: This Question is unanswered, help us to find answer for this one
Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence?
Correct Answer:
java.util.LinkedHashMap
Note: This Question is unanswered, help us to find answer for this one
What is the prototype of the default constructor for following class? public class Test { }
Correct Answer:
public Test( )
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following code: class Printer extends Thread{ private int max = 0; public Printer(int max){ this.max = max; } public void run() { for(int i=1; i<=max; i++){ System.out.println(i); } } public static void main(String[] args){ Printer printer1 = new Printer(3); Printer printer2 = new Printer(2); printer1.start(); printer2.start(); } }
Correct Answer:
1 2 1 2 3
Note: This Question is unanswered, help us to find answer for this one
What modifers are implicitly applied to all interface methods? (Choose all that apply)
Correct Answer:
static
Note: This Question is unanswered, help us to find answer for this one
Which of the following class level (non local) variable declarations will not compile?
Correct Answer:
private synchronized int e;
Note: This Question is unanswered, help us to find answer for this one
Which of these method of Thread class is used to find out the priority given to a thread?
Correct Answer:
getPriority()
Note: This Question is unanswered, help us to find answer for this one
What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?
Correct Answer:
default access
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a valid collection class?
Correct Answer:
HashList
Note: This Question is unanswered, help us to find answer for this one
Consider the below statement:- String string = "UpWork"; Which of the following will output "o"?
Correct Answer:
System.out.println(string.substring(3, 4));
Note: This Question is unanswered, help us to find answer for this one
Which annotation is used to prevent entity field from being saved into the database?
Correct Answer:
@Transient
Note: This Question is unanswered, help us to find answer for this one
Which of the following can be used to bind HTML form parameters into Java EE web service method?
Correct Answer:
@FormParam
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following program? public class UpWork { private String freelancer; private boolean busy: public static void main(String[] args) { UpWork upw = new UpWork(); System.out.print("Busy= " + upw.busy); System.out.print(", Freelancer = " + upw.freelancer); } }
Correct Answer:
Busy = false, Freelancer = null
Note: This Question is unanswered, help us to find answer for this one
Which one is a valid declaration of a boolean?
Correct Answer:
boolean b3 = false;
Note: This Question is unanswered, help us to find answer for this one
What is usually inside the WEB-INF folder of a typical Java Web Application?
Correct Answer:
Compiled classes
Jar libraries
Deployment descriptors
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given code? final byte a = 12; final byte b = 5; System.out.println(a&b);
Correct Answer:
4
Note: This Question is unanswered, help us to find answer for this one
Is it possible to ignore a field or fields during persistence ?
Correct Answer:
By marking field or field @Transient it will ignore at the time of persistence.
Note: This Question is unanswered, help us to find answer for this one
Which of the following can be used to inject URI query parameters into a Java method?
Correct Answer:
@QueryParam
Note: This Question is unanswered, help us to find answer for this one
Which method is used in every Java program?
Correct Answer:
main()
Note: This Question is unanswered, help us to find answer for this one
Which keyword is used for implementing an interface in a class?
Correct Answer:
implements
Note: This Question is unanswered, help us to find answer for this one
What is the internal implementation of ArrayList in Java?
Correct Answer:
ArrayList internally uses array object to add the elements.
Note: This Question is unanswered, help us to find answer for this one
What is the result of the following code? public class JQ { public static void main(String[] args) { f(); } private static void f() { f(); } }
Correct Answer:
It compiles, runs without issues, but never ends, because there's an endless loop.
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given console application? public class Test34 { public static void main(String[] args) { int a = 2; switch(a) { default: System.out.print("_default"); case 0: System.out.print("_ZERO"); case 1: System.out.print("_ONE"); } } }
Correct Answer:
_default_ZERO_ONE
Note: This Question is unanswered, help us to find answer for this one
Which annotation defines unique identifier for a JPA entity?
Correct Answer:
@Id
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the correct way to run a thread?
Correct Answer:
Thread thread = new MyThread(); thread.start();
Note: This Question is unanswered, help us to find answer for this one
Which JDK tool converts java file to bytecode?
Correct Answer:
javac.exe
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following code: for(int i=1; i<10; i++){ System.out.print(" "+i); }
Correct Answer:
1 2 3 4 5 6 7 8 9
Note: This Question is unanswered, help us to find answer for this one
Which of the following classes ease implementation of JavaBean properties?
Correct Answer:
PropertyChangeSupport
VetoableChangeSupport
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
012356
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
_STATIC_MAIN_BASE_INIT_CONST
_STATIC_MAIN_BASE_INIT_CONST
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
false-true
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
liveness
Note: This Question is unanswered, help us to find answer for this one
Which Java EE framework is used to create REST web services?
Correct Answer:
JAX-RS
Note: This Question is unanswered, help us to find answer for this one
Which layout class would you use to lay out components from left to right?
Correct Answer:
FlowLayout
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
00
Note: This Question is unanswered, help us to find answer for this one
What's the output of the following code: int a = 5; while(a > 3){ System.out.print(a--); }
Correct Answer:
5 4
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
null : master
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
10 6
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
2
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Exception instance of IOException is created as unchecked in the main()
method.
Note: This Question is unanswered, help us to find answer for this one
A class has two method implementations that will cause a compiler error. What is the reason for the compiler error? public static void flexiPrint(Object... data){} public static void flexiPrint(Object[] data){}
Correct Answer:
The argument "Object..." is identical to argument Object[].
Note: This Question is unanswered, help us to find answer for this one
Which code snippet below generates random numbers between 0 and 0.5?
Correct Answer:
Random generator = new Random(); double num = generator.nextDouble() * 0.5;
Random generator = new Random(); double num = generator.nextDouble()/2;
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following are legal variable types in java?
Correct Answer:
int
byte
String
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Consider below code: class Ex1{ public static void main(String[] args) { int a[] = { 1,2,053,4}; int b[][] = { {1,2,4} , {2,2,1},{0,43,2}}; System.out.print(a[3]==b[0][2] ); System.out.print(" " + (a[2]==b[2][1])); } } What is the result?
Correct Answer:
true true
Note: This Question is unanswered, help us to find answer for this one
What is the term for the scenario when the compiler infers the type of a wildcard?
Correct Answer:
wildcard capture
Note: This Question is unanswered, help us to find answer for this one
What is the term to describe a situation where two or more threads are blocked forever, waiting for each other?
Correct Answer:
deadlock
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the name of the cookie used by Servlet Containers to maintain session information?
Correct Answer:
SERVLETID
JSESSIONID
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
When a servlet accepts call from a client, it receives:
Correct Answer:
Two objects - ServletRequest&ServletResponse
Note: This Question is unanswered, help us to find answer for this one
When a serializable object is passed to a remote method, it is:
Correct Answer:
Copied to the server
Note: This Question is unanswered, help us to find answer for this one
Which is the correct way to create a daemon/background thread in Java?
Correct Answer:
Thread t = new Thread(); t.setDaemon(true); t.start();
Note: This Question is unanswered, help us to find answer for this one
Distributed Computing in Java means:
Correct Answer:
Objects on different machines working together
Note: This Question is unanswered, help us to find answer for this one
What will be the output, if the following program is run? public class Test8 { public static void main(String[] args) { System.out.println(Math.sqrt(-4)); } }
Correct Answer:
NaN
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given console application? public class Test28 { public static void main(String[] args) { Doc.test(); } } class Doc { public String summary() { return ""doc#""; } public static void test() { Doc[] docs = new Doc[] {new Doc(), new Spec()}; for (Doc d: docs) System.out.print(d.summary()); } } class Spec extends Doc { public String summary() { return ""spc#""; } }
Correct Answer:
doc#doc#
Note: This Question is unanswered, help us to find answer for this one
Consider the following code: MyClasscls = new MyClass("Test Class"); System.out.println(cls); What is the best implementation for printing "Test Class" to the output?
Correct Answer:
Override the toString method in this class and return the string which passes in the constructor.
Note: This Question is unanswered, help us to find answer for this one
Which terms are applicable to the given code? Select all that apply. abstract class Widget { public abstract void draw(); } class Clock extends Widget { public void draw() { // Clock implementation of draw() } } class NewsHeadlines extends Widget { public void draw() { // NewsHeadlines implementation of draw() } } class StockQuotes extends Widget { public void draw() { // StockQuotes implementation of draw() } } public class Test5 { public static void main(String[] args) { java.util.List
Correct Answer:
overriding
polymorphism
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following code snippets will convert variables from long to int and int to long?
Correct Answer:
inti = 5, j = 10, a; double k = 15, l = 20, b; a = (int) (k + l); b = i + j;
Note: This Question is unanswered, help us to find answer for this one
What would be the URL syntax for using third party drivers for establishing a connection with a DBMS having a subprotocol named "webx"?
Correct Answer:
jdbc:webx:dsn name
Note: This Question is unanswered, help us to find answer for this one
What is the name of the process conducted by a bean builder tool to determine properties, methods and events of a JavaBean?
Correct Answer:
introspection
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a Java keyword?
Correct Answer:
wait
Note: This Question is unanswered, help us to find answer for this one
Which of the following is true about the Java Cryptography Extension (JCE)?
Correct Answer:
It is included with the Java 2 platform.
Note: This Question is unanswered, help us to find answer for this one
A previously saved handle has to be retrieved from an EJBObject named 'bookEJBObject'. The following remote interface has been written to restart the processing for that particular request: 1. ObjectInputStream stream = 2. newObjectInputStream(new FileInputStream(fileName)); 3. 4. Handle bookHandle = (Handle) stream.readObject(); 5. 6. BookRemoteInterfacebookEjbObject = (BookRemoteInterface) XX() ; Which of the following should be substituted to Method XX() on line 6?
Correct Answer:
javax.rmi.PortableRemoteObject.narrow(bookHandle.getEJBObject(), BookRemoteInterface.class);
Note: This Question is unanswered, help us to find answer for this one
Which statements are true regarding ServletContextInit Parameters in the deployment descriptor?
Correct Answer:
They are set at deployment-time, but accessed at run-time.
They are set at deployment-time and can be updated at run-time.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which two statements among the following apply to redirecting an HTTP request to another URL in JSP?
Correct Answer:
The path must be relative.
The redirect method must be called before the response body is committed, otherwise an IllegalStateException is thrown.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
An online shop employs a stateless session bean (named ‘Eshop’) to process the request. ‘Eshop’
Uses a declarative transaction management system. The following code is from the XML deployment descriptor file of the bean:
The session and transaction attributes are to be coded in the numbered 10 and 11. Which of the
Following options should be used to make the bean work as expected?
Correct Answer:
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which statements are true regarding using wildcards in java code that uses generics? Select all true statements.
Correct Answer:
A wildcard with a lower bound can be used.
A wildcard with a upper bound can be used.
A wildcard with both a lower and upper bound can be used.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following Java technologies support transaction processing?
Correct Answer:
JTS
JDBC
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the best way to return an array from a function?
Correct Answer:
public String[] test(){
String i[] = new String[5];
return i;
}
Note: This Question is unanswered, help us to find answer for this one
An ArrayList can be shuffled using the Knuth shuffle method by calling Collections.shuffle() method and passing the ArrayList object to it. What is the best way to do a Knuth shuffle on a stack data structure?
Correct Answer:
By using Collections.shuffle() and passing the Stack object to it, similar to ArrayList Knuth shuffle.
Note: This Question is unanswered, help us to find answer for this one
Which code snipped is the best to check whether a String s contains text "oDesk"?
Correct Answer:
if (s.equals("oDesk"))
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are true regarding declaring a servlet instance in a deployment descriptor?
Correct Answer:
The tags are nested within web-app> tags.
It specifies the fully qualified class name of the servlet.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following interfaces makes it possible for Java to save an object to a file and turn it into a data stream?
Correct Answer:
java.io.Serializable
Note: This Question is unanswered, help us to find answer for this one
What exception is thrown by this code, if arr[j]>arr[j+1]:
public static void main(String[] args) {
int []arr={12,23,43,34,3,6,7,1,9,6};
{
int temp;
for (inti=0;i<arr.length;i++)
{
for (int j=0;j<arr.length-i;j++ )
{
if (arr[j]>arr[j+1])
{
temp=arr[j];
arr[j+1]=arr[j];
arr[j+1]=temp;
}
}
}
}
for(inti=0; i<arr.length; i++)
{
System.out.print(arr[i] + " ");
}
}
Correct Answer:
ArrayIndexOutOfBoundException
Note: This Question is unanswered, help us to find answer for this one
Which of the following code snippets will take transform input string "2012/06/05" to output string "05 - 06 - 2012"?
Correct Answer:
String dateString = "2012/06/05"; Date date = new SimpleDateFormat("yyyy/MM/dd").parse(dateString); SimpleDateFormat sdf = new SimpleDateFormat("dd - MM - yyyy"); System.out.println(sdf.format(date));
Note: This Question is unanswered, help us to find answer for this one
In generics code, the question mark (?) is called the?
Correct Answer:
Wildcard
Note: This Question is unanswered, help us to find answer for this one
Which of the following transaction modes are supported by Enterprise Java Beans?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following is true?
Correct Answer:
Each registered name for a servlet is associated with one instance of the servlet.
Note: This Question is unanswered, help us to find answer for this one
With regard to the passivation of beans, which of the following statements is incorrect? A. The process is possible in all the enterprise beans. B. It is accompanied by some vendor specific methods, which are similar to java serialization.
Correct Answer:
A
Note: This Question is unanswered, help us to find answer for this one
Which of the following are liveness problems of a concurrent application?
Correct Answer:
deadlock
Note: This Question is unanswered, help us to find answer for this one
Which distributed object technology is most appropriate for systems that consist entirely of Java objects?
Correct Answer:
RMI
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program? public class Test121 extends _Test121 { { System.out.print("_INIT"); } static { System.out.print("_STATIC"); } Test121() { System.out.print("_CONST"); } public static void main(String[] args) { new Test121(); System.out.print("_|"); new Test121(); } } class _Test121 { { System.out.print("_BIN"); } static { System.out.print("_START"); } _Test121() { System.out.print("_BASE"); } }
Correct Answer:
_START_STATIC_BIN_BASE_INIT_CONST_|_INIT_CONST
Note: This Question is unanswered, help us to find answer for this one
What would be the result when the given code is compiled and ran? public class Test99 { int main() { System.out.println("alpha"); return 0; } public static void main(String args) { System.out.println("beta"); } final static public void main(String[] s) { System.out.println("gamma"); } }
Correct Answer:
compiles, runs, and prints "beta"
Note: This Question is unanswered, help us to find answer for this one
What is the best way to access a HashMap of SortedSet entries?
Correct Answer:
Map String, SortedSet String>>makeSetMap = new HashMap String, SortedSet String>>(); for (String key : makeSetMap.keySet()) { // loop through all manufacturers SortedSet String> cars = makeSetMap.get(key); for (String c : cars) { // loop through all cars of that key System.out.println(key + " " + c); } }
Note: This Question is unanswered, help us to find answer for this one
What is the result of compiling and running the given code? public class Test75 { public static void main(String[] args) { System.out.println(new A(){{}}.toString()); } } class A { public String toString() { return getClass().getName(); } }
Correct Answer:
It compiles, but throws NullPointerException at run-time.
Note: This Question is unanswered, help us to find answer for this one
In an RMI application, network data destined for a particular object received by an object is known as:
Correct Answer:
Stub object
Note: This Question is unanswered, help us to find answer for this one
The EJB specification defines six distinct roles in the application development and deployment life cycle. Which of the following roles is not mentioned in it?
Correct Answer:
EJB Developer
Note: This Question is unanswered, help us to find answer for this one
What is needed to define a property of a JavaBean?
Correct Answer:
supply public getter and setter methods
Note: This Question is unanswered, help us to find answer for this one
Which of the following are "keywords" in Java?
Correct Answer:
default
throws
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which code snippet will check for the existence of the file «text.txt» in the current location?
Correct Answer:
File f = new File(); f.setName(«text.txt»); System.out.println(f.exists());
Note: This Question is unanswered, help us to find answer for this one
What is the easiest and fastest way to sort the following string array?
String[] myString = {"cat","lion", "dog", "mouse"}
Correct Answer:
Collections.Sort(myString);
Note: This Question is unanswered, help us to find answer for this one
Consider the following code: public class Jam { public void apple(int i, String s) { } //ABC } Choose possible valid code replacements of "//ABC" among the choices:
Correct Answer:
public void apple(String s, int i) {}
public void Apple(int i, String s) {}
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
The JDK comes with a special program that generates skeleton and stub objects that is known as:
Correct Answer:
rmic
Note: This Question is unanswered, help us to find answer for this one
Which of the following correctly creates a thread using Runnable()?
Correct Answer:
Runnable r = new Runnable(new Thread({ public void run(){ } })); r.run();
Note: This Question is unanswered, help us to find answer for this one
1 <libraryPrefix:handlerName parameterNAme="value"> 2 <%=23*counter %> 3 <b>Congratulations!</b> Which of the following is the correct way to complete the code snippet above?
Correct Answer:
</libraryPrefix:handlerName>
Note: This Question is unanswered, help us to find answer for this one
Which of the following is true regarding DDL statements?
Correct Answer:
DDL statements are a portion of the SQL standard that is concerned with the creation, deletion and modification of database objects like tables.
DDL statements are a portion of the SQL standard is concerned with manipulating the data in a database.
DDL statements cannot be rolled back.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Assuming the custom tag is GLOOP and the prefix is TWONG, which of the following is the correct JSP syntax for an empty custom tag?
Correct Answer:
<GLOOP:TWONG></GLOOP:TWONG>
<TWONG:GLOOP></TWONG:GLOOP>
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given console application? public class Test31 { public static void main(String[] args) { test(); } public static void test() { try { System.out.print("-try"); return; } catch (Exception e) { System.out.print("-catch"); } finally { System.out.print("-finally"); } } }
Correct Answer:
-try-finally
Note: This Question is unanswered, help us to find answer for this one
Which of the following will programmatically throw an exception?
Correct Answer:
throw new Exception();
Note: This Question is unanswered, help us to find answer for this one
Assuming there is database recovery/backup system in place, which of the following statements is true with regard to committed and uncommitted data of entity beans?
Correct Answer:
Both committed and uncommitted data will survive a server crash if clustering is used.
Note: This Question is unanswered, help us to find answer for this one
Which exception must a setter of a constrained JavaBean property throw to prevent the property value from changing?
Correct Answer:
PropertyVetoException
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the best option for scaling existing an application due to resource requirements, without changing its code?
Correct Answer:
Moving business objects to the client's RAM
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are true regarding the structure of a WebArchive file?
Correct Answer:
It has a WAR extension.
It is extracted by the container upon the first call to any servlet it contains.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements regarding Enterprise Java Beans is incorrect?
Correct Answer:
Message beans send synchronous messages.
Note: This Question is unanswered, help us to find answer for this one
Which method in the HttpServlet class corresponds to the HTTPPUT method?
Correct Answer:
put
Note: This Question is unanswered, help us to find answer for this one
With regard to the destroy lifecycle method, identify the correct statements about its purpose or about how and when it is invoked.
Correct Answer:
It gives the servlet an opportunity to clean up resources.
It is rarely used but can be called to remove a servlet from memory.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following is false?
Correct Answer:
A while loop can be used because next () & previous () methods return -1 beyond the resultset.
Note: This Question is unanswered, help us to find answer for this one
Select all true statements:
Correct Answer:
Methods and variables can be declared final.
A class can be declared as final abstract.
Abstract methods can be overridden.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a tier of three-tier architecture?
Correct Answer:
Security
Note: This Question is unanswered, help us to find answer for this one
Consider the following code: public static void main(String bicycle[]) { System.out.println(bicycle[0]); } What would be the result if "java TwoTyre one two" is entered in the command line?
Correct Answer:
one
Note: This Question is unanswered, help us to find answer for this one
Given a method declared as:
public static
A programmer wants to use the method like this:
// INSERT DECLARATIONS HERE
output = process(input);
Which pair of declarations could be placed at // INSERT DECLARATIONS HERE to allow the code to compile? (Choose all that apply.)
Correct Answer:
ArrayList<Integer> input = null; List<Integer> output = null;
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following code snippets will correctly convert from one time zone to another time zone?
Correct Answer:
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); formatter.setTimeZone(TimeZone.getTimeZone("GMT-8")); Date date = formatter.parse("01/01/2012 05:00:00"); System.out.println(formatter.format(date)); formatter.setTimeZone(TimeZone.getTimeZone("GMT+5")); System.out.println(formatter.format(date));
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); formatter.setTimeZone(new TimeZone("GMT-8")); Date date = formatter.parse("01/01/2012 05:00:00"); System.out.println(formatter.format(date)); formatter.setTimeZone(new TimeZone("GMT+5")); System.out.println(formatter.format(date));
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is/are the OOP concepts demonstrated by this code:
public class Test {
public static void main(String[] args){
Animal a = new Dog();
new Hospital().treatAnimal(a);
}
}
class Animal {
public void sayIt(){
}
}
class Dog extends Animal{
public void sayIt(){
System.out.println("I am Dog");
}
}
class Cat extends Animal{
public void sayIt(){
System.out.println("I am Cat");
}
}
class Hospital{
public void treatAnimal(Animal a){
if(a instanceof Dog){
a.sayIt();
} else {
a.sayIt();
}
}
}
Correct Answer:
Polymorphism
Note: This Question is unanswered, help us to find answer for this one
What will happen to the running session beans if the EJB container crashes or restarts?
Correct Answer:
They will be destroyed.
Note: This Question is unanswered, help us to find answer for this one
What is the central abstraction of the Java Servlet API?
Correct Answer:
The Servlet interface
Note: This Question is unanswered, help us to find answer for this one
Which of the following is true regarding sleep() and wait() in threaded environments?
Correct Answer:
The sleep() method will wait for a specific time (in milliseconds) and continue execution afterwards, while wait() will wait for another thread’s notify() method before it will execute.
Note: This Question is unanswered, help us to find answer for this one
Which of the following symbols are metacharacters supported by the java.util.regex API?
Correct Answer:
.
\
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program?
public class Test117 {
{
System.out.print(«_INIT»);
}
static {
System.out.print(«_STATIC»);
}
Test117() {
System.out.print(«_CONST»);
}
public static void main(String[] args) {
System.out.print(«_MAIN»);
new Test117();
}
}
Correct Answer:
_STATIC_MAIN_INIT_CONST
Note: This Question is unanswered, help us to find answer for this one
Assuming the servlet method for handling HTTPGET requests is doGet(HttpServletRequest req, HTTPServletResponse res), how can the request parameter in that servlet be retrieved?
Correct Answer:
String value=req.getParameter(«product»);
Note: This Question is unanswered, help us to find answer for this one
Why can’t a string’s compareTo method be overridden?
Correct Answer:
The String class is final, therefore its methods can’t be overridden.
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods can be used for reporting a warning on a Connection object, Statement object & ResultSet object?
Correct Answer:
getWarnings()
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a well-known HTTP port?
Correct Answer:
80
Note: This Question is unanswered, help us to find answer for this one
Which distributed object technology is most appropriate for systems that consist of objects written in different languages and that execute on different operating system platforms?
Correct Answer:
CORBA
Note: This Question is unanswered, help us to find answer for this one
What is the output of the given program?
public class Test89 {
public static void main(String[] args) {
T x = new T(«X», null); x.start();
T y = new T(«Y», x); y.start();
T z = new T(«Z», y); z.start();
}
}
class T extends Thread {
private Thread predecessor;
private String name;
public T(String name, Thread predecessor) {
this.predecessor = predecessor;
this.name = name;
}
public void run() {
try {
Thread.sleep((int)(Math.random()*89));
System.out.print(name);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
}
Correct Answer:
any of the following: XYZ, XZY, YXZ, YZX, ZXY, ZYX
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods should be invoked by the container to get a bean back to its working state?
Correct Answer:
EJBActivate()
Note: This Question is unanswered, help us to find answer for this one
With regard to the servlet context listener, which of the following methods is valid?
Correct Answer:
contextInitialized
Note: This Question is unanswered, help us to find answer for this one
Which is the right syntax of a javadoc comment for parameter of the method test(int)?
public class Test125 {
public static void main(String[] args) {
new Test125().test(125);
}
public void test(int a) {
for (int i=0; i<a; System.out.println(i++));
}
}
Correct Answer:
@param a Description
Note: This Question is unanswered, help us to find answer for this one
The transaction attribute of a bean is set to 'TX_REQUIRES_NEW.' What can be inferred about its behavior?
Correct Answer:
The bean manages its own transaction.
Note: This Question is unanswered, help us to find answer for this one
SQLException has a feature of chaining — identify the right code to execute the same from the following:
Correct Answer:
catch(SQLException e)
{
out.println(e.getMessage());
while((e=e.getNextException())!=null)
{
out.println(e.getMessage());
}
}
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the correct syntax for creating a Session object?
Correct Answer:
HttpSession ses=request.getSession(true);
HttpSession ses=request.getSession();
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
The principal finder method that must be implemented by every entity bean class is:
Correct Answer:
findByPrimaryKey()
Note: This Question is unanswered, help us to find answer for this one
Why would the following code snippet not compile successfully?
if (mangoList instanceof List<Mango>) { System.out.println(«true»); }
Correct Answer:
Generic types are erased before runtime.
Note: This Question is unanswered, help us to find answer for this one
Consider the following:
String sub ="hello".substring(2, 3);
What is the value of sub?
Correct Answer:
''l''
Note: This Question is unanswered, help us to find answer for this one
What would happen on compiling and running the following code?
public class Test
{
public static void main (String args[])
{
TestThread t = new TestThread ();
t.setValue (5);
t.start ();
t.setValue (10);
}
}
class TestThread extends Thread
{
private int value;
synchronized public void setValue (int v)
{
value = v;
}
public void run ()
{
System.out.println ("before: " + value);
setValue (50);
System.out.println ("after: " + value);
}
}
Correct Answer:
When run, this code will always print ''before: 5'' and ''after: 10''
Note: This Question is unanswered, help us to find answer for this one
Can Java be used to send ICMP packets?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Which of these interfaces is the most applicable when creating a class that associates a set of keys with a set of values?
Correct Answer:
Map
Note: This Question is unanswered, help us to find answer for this one
How does the set collection deal with duplicate elements?
Correct Answer:
The add method returns false if you attempt to add an element with a duplicate value
Note: This Question is unanswered, help us to find answer for this one
For a class defined inside a method, what rule governs access to the variables of the enclosing method?
Correct Answer:
The class can only access final variables
Note: This Question is unanswered, help us to find answer for this one
Is the following code valid?
InetAddress ad = InetAddress.getByName ("195.186.2.111");
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
How many objects are created by the following code?
Object a, b, c, d, e;
e = new Object ();
b = a = e;
e = new Object ();
Correct Answer:
2
Note: This Question is unanswered, help us to find answer for this one
What is Abstraction?
Correct Answer:
An act of representing essential features without including details or working methodology
Note: This Question is unanswered, help us to find answer for this one
Which of the following will ensure that garbage collection runs?
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following will ensure that garbage collection runs?
Correct Answer:
The code will throw an exception as records are being printed after the connection is closed
Note: This Question is unanswered, help us to find answer for this one
Which sequence will be printed when the following program is run?
import java.util.*;
public class Test
{
public static void main(String str[])
{
List l = new ArrayList();
l.add(''1'');
l.add(''2'');
l.add(1,''3'');
System.out.println(l);
}
}
Correct Answer:
[1, 3, 2]
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are correct?
Correct Answer:
A class is an instance factory
A class is a template for creating an entity
A class is a set of all the instances of a pattern
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What would happen on trying to compile and run the following code?
public class Test
{
public static void main (String args[])
{
int iRand;
iRand = Math.random();
System.out.println(iRand);
}
}
Correct Answer:
A compilation error referring to a cast problem
Note: This Question is unanswered, help us to find answer for this one
How many times can classes be nested within a class?
Correct Answer:
Any number of times
Note: This Question is unanswered, help us to find answer for this one
What is printed to the standard output if myMethod() is executed?
class MyPoint {
void myMethod() {
int x, y;
x = 5; y = 3;
System.out.print( " ( " + x + ", " + y + " ) " );
switchCoords( x, y );
System.out.print( " ( " + x + ", " + y + " ) " );
}
void switchCoords( int x, int y ) {
int temp;
temp = x;
x = y;
y = temp;
System.out.print( " ( " + x + ", " + y + " ) " );
}
}
Correct Answer:
(5, 3) (3, 5) (5, 3)
Note: This Question is unanswered, help us to find answer for this one
Choose the correct declarations for the main() method which will allow the class to be run as a standalone program:
Correct Answer:
static public void main(String str[])
public static void main(String str[])
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the method by which two or more applets can communicate with each other within one HTML page?
Correct Answer:
getAppletContext()
Note: This Question is unanswered, help us to find answer for this one
What will be the output when this code is compiled and run?
public class Test
{
static int x = 10;
public Test ()
{
Bar b = new Bar ();
Bar b1 = new Bar ();
update (b);
update (b1);
}
private void update (Bar bar)
{
bar.x = ++x;
System.out.println (bar.x);
}
public static void main (String args[])
{
new Test ();
}
private class Bar
{
public int x = 10;
}
}
Correct Answer:
11 12
Note: This Question is unanswered, help us to find answer for this one
Which of these is not an event listener adapter defined in the java.awt.event package?
Correct Answer:
ActionAdapter
Note: This Question is unanswered, help us to find answer for this one
Can InetAddress be used with inet6?
Correct Answer:
Yes
No, InetAddress is an abstract class
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Object.hashCode () will always return the same value for a given object. This is consistent from one execution of an application to another execution of the same application.
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
What will be the output when this code is compiled and run?
public class Test
{
public Test ()
{
Bar b = new Bar ();
Bar b1 = new Bar ();
update (b);
update (b1);
b1 = b;
update (b);
update (b1);
}
private void update (Bar bar)
{
bar.x = 20;
System.out.println (bar.x);
}
public static void main (String args[])
{
new Test ();
}
private class Bar
{
int x = 10;
}
}
Correct Answer:
20 20 20 20
Note: This Question is unanswered, help us to find answer for this one
What would happen on compiling and running the following code?
public class Anchor
{
public static void main(String[] argv)
{
new Anchor();
}
public Anchor()
{
String s[][] = new String[2][2];
System.out.println(s[1][1]);
System.out.println(s[1][2]);
}
}
Correct Answer:
Compiles and prints null followed by ArrayIndexOutOfBoundsException
Note: This Question is unanswered, help us to find answer for this one
What happens on attempting to compile and run the following code?
public class Graft
{
public static void main(String argv[])
{
Graft g = new Graft();
}
protected Graft()
{
for(int i =0; i <10; i ++)
{
System.out.println(i);
}
}
}
Correct Answer:
Successful compilation with output 0 to 9
Note: This Question is unanswered, help us to find answer for this one
Which of the following are the methods of the Thread class?
Correct Answer:
yield()
sleep(long millis)
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
In which class is the notify method defined?
Correct Answer:
Object
Note: This Question is unanswered, help us to find answer for this one
What will be the output when this code is compiled and run?
public class Test
{
static int a;
int b;
public Test ()
{
int a, b, c;
a = b = c = 20;
System.out.println (a);
}
public static void main (String args[])
{
new Test ();
}
}
Correct Answer:
20 is printed
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements is not correct with regard to threads in Java?
Correct Answer:
The wait and notify methods are defined in the Thread class
Note: This Question is unanswered, help us to find answer for this one
Select the correct option based upon the following sample code:
public class Test
{
static int a;
int b;
public Test ()
{
int c;
c = a;
a++;
b += c;
System.out.println ("one");
}
public void Test ()
{
int c;
c = a;
a++;
b += c;
System.out.println ("two");
}
public static void main (String args[])
{
Test t = new Test ();
}
}
Correct Answer:
The code will compile and run successfully. It will print ''one''
Note: This Question is unanswered, help us to find answer for this one
What is Encapsulation?
Correct Answer:
Wrapping functions and data into a single unit
Note: This Question is unanswered, help us to find answer for this one
Which of the following illustrates correct synchronization syntax?
Correct Answer:
public void Process(){
synchronized(this){
}
}
public synchronized void Process(){}
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
One method in your application needs to be synchronized. Which of the following options are correct for synchronization?
Correct Answer:
public void Process(){
synchronized(this){
}
}
public synchronized void Process(){}
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What would be the result of compiling and running the following code class?
public class Test
{
public static void main (String args[])
{
Test t = new Test ();
t.start ();
}
public void start ()
{
int i = 2;
int j = 3;
int x = i & j;
System.out.println (x);
}
}
Correct Answer:
The code will compile and print 2
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods are members of the Vector class and allow you to input a new element?
Correct Answer:
addElement
Note: This Question is unanswered, help us to find answer for this one
Will the following code bind srvSock ?
srvSock = new ServerSocket();
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
For the given variables, which of the following will compile without an error?
char c = 'c';
int i = 50;
double d = 80;
long l = 200;
String s = "Goodbye";
Correct Answer:
s+=i;
Note: This Question is unanswered, help us to find answer for this one
What would happen on trying to compile and run the following code?
public class MainCls
{
public static void main(String argv)
{
System.out.println("My Text");
}
}
Correct Answer:
The code will compile. A runtime error will occur because 'main' is not properly defined
Note: This Question is unanswered, help us to find answer for this one
Inheritance is a process by which the objects of parent class acquire the properties of the child class.
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Which class contains a method to create a directory?
Correct Answer:
File
Note: This Question is unanswered, help us to find answer for this one
What protocol is used by the DatagramSocket class?
Correct Answer:
UDP
Note: This Question is unanswered, help us to find answer for this one
What is wrong with the following code?
class X extends Exception {}
public class Y
{
public void foo()
{
try {
b();
}
finally {
ba();
}
catch (MyException e) {}
}
public void b() throws X {
throw new X();
}
public void ba() throws RuntimeException {
throw new RuntimeException();
}
}
Correct Answer:
Finally block should come after the catch block
Note: This Question is unanswered, help us to find answer for this one
All class methods in the java.lang package are thread safe. (in 1.5)
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a benefit derived from using OOPS?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
What will be written to the standard output when the following program is run?
public class X {
public static void main(String args[]) {
System.out.println(11 ^ 2);
}
}
Correct Answer:
9
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods is used to get the parameters of an applet?
Correct Answer:
getParameter()
Note: This Question is unanswered, help us to find answer for this one
Are the following two statements equivalent?
A: Thread.yield ();
B: Thread.sleep (0);
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
You want to loop through an array and stop when you come to the last element. Which of the following give information about the size of array, if its name is arMark?
Correct Answer:
arMark.length;
Note: This Question is unanswered, help us to find answer for this one
Can ServerSocket be used with UDP?
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?
class A {}
class B extends A {}
class C extends A {}
public class X {
public static void main(String args[]) {
A x = new A();
B y = new B();
C z = new C();
// insert statement here
}
}
Correct Answer:
x = y;
y = (B)x;
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the correct syntax for suggesting that the JVM perform garbage collection?
Correct Answer:
System.gc();
Note: This Question is unanswered, help us to find answer for this one
What is the return type of the method ceil(double) from the Math class?
Correct Answer:
double
Note: This Question is unanswered, help us to find answer for this one
What is the java.net.IDN class in 1.6?
Correct Answer:
Methods to convert internationalized domain names (IDNs) between a normal Unicode representation and an ASCII Compatible Encoding (ACE) representation
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following code?
import java.util.*;
public class Test
{
public static void main (String args[]) throws Exception
{
List l = new ArrayList ();
int a = (int)(3 * 2.5);
for (int i = 0; i < 10; i++)
l.add (i);
String s = "Hello";
l.add (a, s.getBytes ("UTF-8")[2]);
System.out.println (l);
}
}
Correct Answer:
[0, 1, 2, 3, 4, 5, 6, 108, 7, 8, 9]
Note: This Question is unanswered, help us to find answer for this one
What will be the output of this program?
public class Test
{
public static void main (String args[])
{
int a, b;
a = 2;
b = 0;
System.out.println (g (a, new int[] {b}));
}
public static int g (int a, int b[])
{
b[0] = 2 * a;
return b[0];
}
}
Correct Answer:
4
Note: This Question is unanswered, help us to find answer for this one
Can the constructor of a class be made private?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
What is true regarding the User Datagram Protocol (UDP)?
Correct Answer:
A message is never partial
Messages are not guaranteed to arrive at destination
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
is true regarding the socket API?
Correct Answer:
None of them is true
Note: This Question is unanswered, help us to find answer for this one
Is the following statement true or false?
A .java file without any source code is a valid java file.
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements is true of the HashMap class?
Correct Answer:
It stores information as key/value pairs
Note: This Question is unanswered, help us to find answer for this one
What should be the replacement of "//ABC" in the following code?
class Krit
{
String str= new String("OOPS !!! JAVA");
public void KritMethod(final int iArgs)
{
int iOne;
class Bicycle
{
public void sayHello()
{
//ABC
}
}
}
public void Method2()
{
int iTwo;
}
}
Correct Answer:
System.out.print(str);
System.out.print(iArgs);
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the superclass of java.net.DatagramSocket?
Correct Answer:
java.lang.Object
Note: This Question is unanswered, help us to find answer for this one
Choose the correct statement:
Correct Answer:
A call to a constructor in a parent class can only be made from within a constructor
Note: This Question is unanswered, help us to find answer for this one
What will be the output of this program?
public class Test
{
public static void main (String args[])
{
String a, b, c, d;
a = ''Hello1234'';
b = ''Hello'' + String.valueOf(1234);
c = ''Hello'' + ''1234'';
d = new String (new char[]{'H', 'e', 'l', 'l', 'o', '1', '2', '3', '4'});
System.out.print (a == b);
System.out.print ('' '');
System.out.print (a.equals(b));
System.out.print ('' '');
System.out.print (a == c);
System.out.print ('' '');
System.out.print (a.equals(c));
System.out.print ('' '');
System.out.print (a == d);
System.out.print ('' '');
System.out.print (a.equals(d));
System.out.print ('' '');
}
}
Correct Answer:
false true true true false true
Note: This Question is unanswered, help us to find answer for this one
What will the length() method in the File class return?
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following program?
public class Test
{
public static void main (String args[ ])
{
B o = new A ();
System.out.println (o.content ());
}
public String content () throws Exception
{
throw new Exception (''This is an exception on this.content ()'');
}
private static class B
{
public String content ()
{
return ''B'';
}
}
private static class A extends B
{
public String content ()
{
return ''A'';
}
}
}
Correct Answer:
The code will compile and on running, it will print ''A''
Note: This Question is unanswered, help us to find answer for this one
Is it possible to create an array of zero length?
Correct Answer:
YES
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Use CORBA
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Remote object appears same to the client machine as it does to the server machine
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The taglib directive can reference a TLD by name
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ServletRequest
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Create a single connection object in the init () method and implement SingleThreadModel
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ServletResponse Interface
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Its base classIts derived class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It can return a value or throw an exception
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
In the DMZ
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public interface Remote { //empty }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
7 9
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A format and content for digital certificates
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
7
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Stub object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
cisco.com
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JTA
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All the three of the above statements hold True.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JTS
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
X/Open SQL Call Level Interface (CLI)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
hello world
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JSESSIONID
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Centralized object server
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
'Que Reader' within HTML comment markers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java and Java
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The application can pass and return remote object references as part of its normal operation
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
CallableStatement cannot take IN OUT parameters
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jsp:useBean id="houseLotBean" scope="session" class="session.Realestate"/
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
4
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Object name
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ps.clearParameters(); <br>ps.setInt(1,3); ps.setDouble(2,790.50); ps.executeUpdate();
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Model-View-Controller
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Implementation of SingleThreadModel
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both statements 1 and 2 are correct.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
This pattern involves a single class which is responsible to create an object while making sure that the only single object gets created.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All the three of the above Statements hold True.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Native-Protocol /All-Java Driver
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); <br>ResultSet srs=st.executeQuery("SELECT CUS_NAME,PRICE FROM CUSTOMER");
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
This pattern hides the complexities of the system and provides an interface to the client using which the client can access the system.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Implement session tracking and use HttpSession object to hold onto connection for each user
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
java.rmi.Naming.rebind ("name", object);
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Shut down and restart rmiregistry
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is a hybrid of java and javac commands
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
400
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
WEB-INF\classes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NO
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is not possible
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All the three of the above Statements hold True.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
java.rmi.server.UnicastRemoteObject
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
response.sendError(HTTPServletResponse.SC_FORBIDDEN,"Error");
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Reference
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public abstract void init(ServletConfig cof) throws ServletException
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is not possible
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Implement an interface that extends java.rmi.Remote interface
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public interface RemoteTrain extends java.rmi.Remote
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
getBinaryStream()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All the three of the above Statements hold True.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
start rmiregistry 2005
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public void destroy() {// code...}
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Granted entries
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Stub object perform networking routine
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Its school education system
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Using access declaration for the private members of base class.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
This pattern refers to creating a duplicate object while keeping the performance in mind.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Problem statement
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both the above Statements hold True.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
compile time error
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
%=(new java.util.Date()).toLocaleString() %
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Model-view-Controller
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
custom ClassLoader object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
createStatement(int RSType, int RSConcurrency);
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class Inheritance
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An object that implements a context listener is notified when its Web App context is created or destroyed
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Object servers can get remote object references only as method parameters or return values
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both the above Statements holds True.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is a JAR archive of the WebApplication structure
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Driver's native code can crash the entire server
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
3
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
myMethod({"a", "b", "c"});
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Used to construct a singleton
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
new
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes. You need not specify an unchecked exception, but you are allowed to do so.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Enum can implement an interface.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
String value() default "";
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
private
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@Retention(RetentionPolicy.RUNTIME)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No, there is an error in hibernate and generates an exception
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
0
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Infinite loop
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Arrays
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Runs successfully and prints
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
is an instance initializer, additional to constructor and called before it
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
checkb.addListener(Listener);
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
false
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Pass by value only.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A nested class is any class that is defined within another class. An inner class is a non-static nested class.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
a reserved but unused keyword
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
O(n^2)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
8
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
final
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
(-1 >>> 1) == Integer.MAX_VALUE
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The subclass constructor in question makes an explicit call to another of its superclass's constructors.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@Overload
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Acquiring the built-in lock associated with the object referenced by the synchronized statement
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
class A, classes from package P
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Double
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Compilation error
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
false
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An abstract class cannot implement an interface.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A static inner class has no reference to its parent class, a non static inner class does.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
-128 and 127
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JSSE
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Elimination of Casts when getting objects from Collections
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
x can be true because of Java String interning.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Guarantee that the field's current value is read, not a thread-cached value.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
List
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Comparable and Serializable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
None of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@interface MyAnnotation { /* ... */ }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
return, goto and default are keywords in the Java language
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
atomic
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
suspend()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
HttpServletRequest
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Whenever the JVM's garbage collection algorithm decides to call it.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Xmx
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
it is transient
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
package-private
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Suggests that the JVM run garbage collection to reclaim memory.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
memory and allocates it as necessary.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
0, 8
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The owning object's (this's) mutex.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The code throws NullPointerException.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The code prints "null" on console.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JNDI API and JNDI SPI
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
?
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
component set (subclasses of JComponent),support classes,interfaces
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
multiple interfaces.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
transient
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Collections.sort
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
static
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A class that does not define all of its methods
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It can either be a FileReader or a BufferReader.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
finalize
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
that, if constant, they cannot be changed once they are created.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public int hashCode()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
you end up with one copy of the data and two references to the data.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
In order to execute
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
for (Object o : collection)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Obtain the names of a class' members and display them at runtime.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The object reference variable 'a1' is declared.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Prevents concurrency within methods or statements
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
java -jar program.jar
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
boolean isNull()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
...will generally run under future versions of the platform.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
SortedMap
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
java.util.concurrent.ConcurrentHashMap
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
hello
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
reference, where the data is accessed indirectly.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
they have multiple call signatures
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Equals
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Method overriding
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Declare the class as final.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
abstract methods
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The method cannot be overridden in subclasses.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Sun Microsystems (Oracle)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public static void main(String [] args) { }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
import
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
all platforms.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
all of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
javac compiler
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public static void main(String[] args)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Inheritance
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
typecasting
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
try, catch, finally
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
||
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
break; continue
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
processes the java code through the Java Virtual Machine (JVM).
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
package
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public static void main(String[] args)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
class MyDerived extends MyClass
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
all of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes, as long as they are public, static and final
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
the Singleton pattern
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Passed by value
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ArrayList<String> myList = new ArrayList<Integer>();
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
static methods cannot refer to "this" or "super"
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
"dive" must be a method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
m=3
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
They are not equal
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
creating strings which change considerably.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these answers are correct
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
They may exist, but they must be public, static and final.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
join()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ThreadLocal
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
use the getClass() method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
One
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes, but will not run
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
a constructor.
Note: This Question is unanswered, help us to find answer for this one
Java MCQs | Topic-wise