ranganath kini


{ City } bangalore
< Country > india
* Profession *
User No # 1131
Total Questions Posted # 0
Total Answers Posted # 19

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 245
Users Marked my Answers as Wrong # 39
Questions / { ranganath kini }
Questions Answers Category Views Company eMail




Answers / { ranganath kini }

Question { IBM, 20448 }

What is the difference between throw and throws?


Answer

The 'throw' statement initiates an exception to be thrown
where as the 'throws' clause declares that the method is
expected to throw 1 or more checked execptions.

Is This Answer Correct ?    43 Yes 5 No

Question { 3816 }

Which method will get invoked first in a stand alone
application?


Answer

The first method that is invoked in a stand alone Java app
is the 'main' method which must have the following signature:

public static void main( String[] args )

Is This Answer Correct ?    8 Yes 0 No


Question { 11158 }

What is the purpose of finalization?


Answer

Finalization is a facility provided by Java for classes who
use native resources to clean up before the objects are
garbage collected.

Since native resources or allocations are beyond the control
of Java's garbage collector, the responsibility of cleaning
up that native allocations falls on the object's
finalization code which shud ideally initiate quick clean up
operations and free any native memory it has allocated.

If finalization is not done, then the native resources wud
be left in the memory even after thier related Java
instances have been removed by the Java's GC. Hence it is an
invaluable feature.

But it needs to be used with caution as finalization
consumes more processing by Java

Is This Answer Correct ?    5 Yes 2 No

Question { 4750 }

What is run-time class and system class? what is their
purpose?


Answer

The System (along with the Runtime class) provide system
level functionality to Java applications.

The facilities of these classes are not necessarily portable
across host operating system and may need to be recompiled
when porting.

Some of the facilities provided are:
1. Reading from the keyboard as input
2. Writing to console output
3. Interaction with JVM process for event notification, or
information such as free memory, etc
4. Reading/writing system properties/environment variables
5. executing other programs from within java apps

Is This Answer Correct ?    0 Yes 0 No

Question { 9376 }

What is Runtime class and its purpose?


Answer

The Runtime(along with the System class) provide system
level functionality to Java applications.

The facilities of these classes are not necessarily portable
across host operating system and may need to be recompiled
when porting.

Some of the facilities provided are:
1. Reading from the keyboard as input
2. Writing to console output
3. Interaction with JVM process for event notification, or
information such as free memory, etc
4. Reading/writing system properties/environment variables
5. executing other programs from within java apps

Is This Answer Correct ?    10 Yes 4 No

Question { 9343 }

What is System class and its purpose?


Answer

The System (along with the Runtime class) provide system
level functionality to Java applications.

The facilities of these classes are not necessarily portable
across host operating system and may need to be recompiled
when porting.

Some of the facilities provided are:
1. Reading from the keyboard as input
2. Writing to console output
3. Interaction with JVM process for event notification, or
information such as free memory, etc
4. Reading/writing system properties/environment variables
5. executing other programs from within java apps

Is This Answer Correct ?    4 Yes 3 No

Question { 5702 }

What is the use of ?this??


Answer

The 'this' keyword in Java has the following uses:

1. To resolve ambiguity where a local variable hides a class
member. Example:

class MyClass {
private int value;

public MyClass( int value ) {
// local variable 'value' hides class field 'value'
this.value = value;
}
}

2. To invoke one constructor overload from another. Example:

class MyClass {
private int value;

public MyClass( int value ) {
this.value = value;
}

public MyClass() {
// invoke MyClass( int value )
this( 0 );
}
}

3. To pass the current object instance as a parameter to a
method. Example:

class MyClass {
private int value;

public MyClass( int value ) {
this.value = value;
// pass current instance as a parameter to the method
displayValue( this );
}

public static void displayValue( MyClass mc ) {
System.out.println( "Value = " + mc.value );
}
}

4. To invoke an outer class's non-static method from a
non-static inner class. Example:

class MyOuterClass {

class MyInnerClass {
public MyInnerClass() {
// call the outer class's method
MyOuterClass.this.displayText( "Inner instance
created" );
}
}

public void displayText( String text ) {
System.out.println( text );
}
}

Is This Answer Correct ?    2 Yes 0 No

Question { 5405 }

In what circumstances, compiler will supply a default
constructor for a class?


Answer

If no constructors are explicitly defined for the class,
Java supplies a default no-arg constructor which does
nothing more than initialize the fields of the class to
their default value.

Is This Answer Correct ?    0 Yes 0 No

Question { Wipro, 28102 }

How 'java' got its name and what it stands for?


Answer

"Java" is supposed to have got its name from one of the
members of the original developer team Kim Polese. But it is
widely believed that Java (originally called "Oak") was
concieved by the original creators at a local coffee bar.

To credit this incident, the creators used a magic number as
a header to all the Java bytecode class file. The number:
0xCAFEBABE

here is a link if u want to know more:
http://en.wikipedia.org/wiki/Class_(file_format)

Is This Answer Correct ?    47 Yes 8 No

Question { 4338 }

Name the method that is used to set a TextComponent to the
read-only state?


Answer

The setEditable( boolean b ) is used to set a TextComponent
to a read-only state

Is This Answer Correct ?    5 Yes 0 No

Question { 11697 }

Which java.util classes and interfaces support event
handling?


Answer

The interface java.util.Observer interface and the
java.util.Observable class support event handling

Is This Answer Correct ?    6 Yes 9 No

Question { 5682 }

Who developed JScript language?


Answer

JScript is a derivative the ECMAScript standard regulated by
the ECMA standards comittee. ECMAScript/JavaScript became a
popular scripting language that cud be embedded into
standard HTML/XHTML pages to perform dynamic client-side
actions. Netscape supported JavaScript in their Navigator
web-browser and Microsoft added it to Microsoft Internet
Explorer

Soon Microsoft started developing extra features for the
language such as new objects and added this to their
Internet Explorer product. This cause a lot of problems for
web developers to provide a consistent experience of their
web sites across different browsers.

Hence Microsoft took off and renamed their implementation of
the ECMAScript as JScript.

Is This Answer Correct ?    3 Yes 0 No

Question { HCL, 8126 }

In howmany ways a thread can be created?


Answer

1. Extending the Thread class
2. Implementing Runnable interface in a class and then
passing its reference to a new Thread.
3. Creating an anonymous class to extend the Thread class.
4. Creating an anonymous class to implement the Runnable
interface and then passing its reference to a new Thread.

Is This Answer Correct ?    2 Yes 1 No

Question { 5283 }

What method is used to create the daemon thread?


Answer

the Thread.setDaemon() has to be invoked. It takes one
boolean param indicating if the thread is a daemon thread
or not. the setDaemon() has to invoked before the start()
method is called on the thread, else an
IllegalThreadStateException is throw indicating that the
thread is active and its daemon state cannot be altered.

Is This Answer Correct ?    5 Yes 0 No

Question { 6026 }

What is runnable?


Answer

java.lang.Runnable is an interface implemented by all
threads. It contains a method called run() that needs to be
implemented by all threads. The run() method is called when
the thread is given permission to execute

Is This Answer Correct ?    8 Yes 2 No

 [1]   2    Next