Greek f = (Beta)(Alpha)x;
Alpha a = x;
Greek f = (Alpha)x;
Beta b = (Beta)(Alpha)x;
Greek f = (Delta)x;
Node1.node = new Node();
Node1 = null;
Node1.node = null;
Node1 = node1.node;
Node1 = new Node();
Public void run()
Public void start()
Public void stop()
Public void suspend()
Container.setComponent(component); component=newComponent(); component.setParam(100);
Component = new Component(); component.setParam(100);container.setComponent(component);
Component.setParam(100);
Component = new Component(); component.setParam(100);
Container.getComponent().setParam(100);
Prints: 1, true
Prints 2, false
Prints: 2, true
Prints: 1, false
Welcome Planet
Compilation Error
Compiles and Executes with no output
Planet
Planet Welcome
Prints: T1T2T2
Prints: T1T2T3
Prints: T1T1T2
Prints: T1T1T3
Prints: T1T1T1
NavigableSet
Deque
NavigableMap
NavigableList
Cloneable interface
Serializable interface
Readable interface
Externalizable interface
Writable interface
Color treeColor = Color.GREEN;
Color purple = new Color( 0xff00ff);
Color skyColor = BLUE;
If( RED.getRGB() < BLUE.getRGB() ) {}
If( Color.RED.ordinal() < Color.BLUE.ordinal() ) {}
Public class Circle extends Shape {private int radius;public void setRadius(int radius) { this.radius = radius; }public int getRadius() { return radius; }public void draw() {/* code here */}}
Public class Circle extends Shape {private int radius;public void draw();}
Public abstract class Circle extends Shape {private int radius;}
Public class Circle implements Shape {private int radius;}
Public class Circle extends Shape {public int radius;private void draw() {/* code here */}}
Labeled continue
Labeled goto
Labeled throw
Labeled catch
Labeled break
Runtime Error "IllegalThreadStateException"
Prints the following output 2 times: Planet(waits for 1000 milli seconds)Earth
Compile-time Error
Prints the following output 1 time: Planet(waits for 1000 milli seconds)Earth
Prints the following output:PlanetPlanet(get into long wait. Never ends)
Beta has-a Gamma and Gamma is-a Alpha.
Gamma has-a Beta and Gamma is-a Alpha
Alpha is-a Gamma and has-a Beta.
Gamma is-a Beta and has-a Alpha.
Alpha has-a Beta and Alpha is-a Gamma.
Public void eatMe() throws BitterException, SourException
Public void eatMe() throws Throwable
Public void eatMe() throw BadTasteException
Public void eatMe() throws BadTasteException
Public void eatMe() throws RuntimeException
CharAt(13)
CharAt(15)
CharAt(12)
CharAt(16)
CharAt(14)
Public class Test2 {static public void main(String[] in) {System.out.println("Test2");}}
Public class Test4 {static int main(String args[]) {System.out.println("Test4");}}
Public class Test1 {public static void main() {System.out.println("Test1");}}
Public class Test3 {public static void main(String args) {System.out.println("Test3");}}
Public class Test5 {static void main(String[] data) {System.out.println("Test5");}}
Reads the text from keyboard and prints the same to theconsole on pressing Ctrl Z, flushes (erases) the same from theconsole.
Reads the text from keyboard character by character andprints the same to the console on typing every character.
Reads the text from keyboard line by line and prints the sameto the console on pressing ENTER key at the end of every line
Reads the text from keyboard line by line and prints the sameto the console on pressing ENTER key at the end of every line,then the same is flushed (erased) from the console.
Reads the text from keyboard and prints the same to theconsole on pressing Ctrl Z
Inheritance
Polymorphism
Persistence
Aggregation
Association
True
False
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");try {Date d = df.parse(dob);} catch(ParseException pe) { }
GregorianCalendar g = new GregorianCalendar(dob);Date d = g.getDate();
Calendar c = new Calendar(dob);Date d = g.getDate();
Date d = new Date(dob);
CalendarFormat cf = newSimpleCalendarFormat("dd/MM/yyyy");try {Date d = cf.parse(dob);} catch(ParseException pe) { }
Welcomeclass two
Throws a compile time exception as overridden method a()does not throw exception smile
Class two
Throws a compile time exception as overridden method z()does not throw exception smile
Two
Compile-time error: Wrapper types cannot be comparedusing equals
Compile-time error: Integer wrapper cannot accept char type
Prints: equals
Prints: EQ
Prints: equals EQ
HelloolleH55
HelloolleH44
HelloHello44
HelloHello33
HelloHello55
To automatically delete objects from a container as soonclients stop referencing them
To allow clean up after finalization but before the space isreclaimed
To keep objects alive provided there is enough memory
To keep objects alive only while they are in use (reachable) byclients
Compile-time error
Runtime Error
NO
False
True
ToString()
CompareTo(Object)
HashCode()
Equals(Object)
Run()
Throws a Runtime error 'Illegal forward reference'
1000
Compiler complains about forward referencing of membervariables first and second
Compiler complains about private memebers is notaccessible from main() method
Inheritance enables adding new features and functionality toan existing class without modifying the existing class
In an inheritance hierarchy, a superclass can also act as a subclass
Inheritance is a kind of Encapsulation
Inheritance does not allow sharing data and methods amongmultiple classes
In an inheritance hierarchy, a subclass can also act as a superclass
Welcome Planet
The code runs with no output
Compilation fails
Welcome 5
Welcome Planet 5
Annotations are not part of a program.
Annotations are predefined classes.
Annotations are data about program.
Annotations are static methods.
Prints: 21 21
Prints: 20 21
Compilation Error: Non-static method methodB() cannot be referenced from static context methodA()
Prints: 20 20
Prints: 21 20
ArrayList< Double > a = new ArrayList < Double >();
ArrayList< Integer > a = new ArrayList< Double >();
ArrayList< WrapperType > a = new ArrayList< WrapperType >();
ArrayList< Number > a = new ArrayList< Number >();
ArrayList< Integer > a = new ArrayList< Integer >();
All exceptions are thrown programmatically from the code or API
All exceptions are thrown by JVM
JVM cannot throw user-defined exceptions
JVM thrown exceptions can be thrown programmatically
All RuntimeException are thrown by JVM
Default (blank), that is, the method declaration would readvoid setWidth( int n )
Final
Private
Protected
Public
Transforms s1 into the union of s1 and s2
Transforms s1 into the (asymmetric) set difference of s1 ands2
Transforms s1 into the intersection of s1 and s2.
Copies elements from s2 to s1
Returns true if s2 is a subset of s1
Since widgetCount is private, only methods in the Widgetclass can access it.
If another class tries to access widgetCount, a runtimeexception will be thrown.
Since widgetCount is private, only the addWidget method canaccess it.
Since widgetCount is private, only methods in the Widgetclass and any derived classes can access it.
Null pointer exceptionCatchable caughtnull pointer exception
Runtime error
Catchable caughtnull pointer exceptionnull pointer exception
Compile-time error
Null pointer exceptionnull pointer exceptionCatchable caught
To call the join() method, a thread must own the lock of theobject on which the call is to be made
To call the yield() method, a thread must own the lock of theobject on which the call is to be made.
To call the wait() method, a thread must own the lock of theobject on which the call is to be made.
To call the wait() method, a thread must own the lock of thecurrent thread.
To call the sleep() method, a thread must own the lock of theobject which the call is to be made.
Last()
HasRecords()
Previous()
Next()
First()
SQLWarning is the subclass of SQLException
SQLWarning and SQLException can be used interchangeably
SQLWarning affects the normal program execution
SQLWarning messages are accessible through the Statementobject
SQLWarning can be caught and handled using try-catch
Author(name = "Deepak",date = "02/04/2008")class MyClass() { }
@Author(name = "Deepak",)class MyClass() { }
@Author("Deepak","02/04/2008")class MyClass() { }
SELECT * BULK COLLECT INTO emp_details_t from emp;
@Author(name = "Deepak",date = "02/04/2008")class MyClass() { }
True
False
If (x != y[0].toString()) {
If (x & y[0]) {
If (x.equals(y[0])) {
If (!x.equals(y[0])) {
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.