what is the purpose of the final in the try-catch-final
Answer Posted / guest
finally will execute after catch block if try throw
exception else it will execute after try.
ex:
class a
{
public static void main(String []asd)
{
try
{
throw new Exception();
}catch(Exception e)
{
System.out.println("catch");
}
finally{
System.out.println("finally");
}
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the list interface in java programming?
What is the memory leak in java?
What are checked exceptions?
Which types of exceptions are caught at compile time?
os is developed in c no java is more secured then c na why dont the os developed is developed using java
Is arraylist dynamic in java?
What is pojo class in java?
Does java allow overriding static methods ?
Explain about varargs in java?
Is there any way to find whether software installed in the
system is registered by just providing the .exe file?
I have tried the following code but its just displaying the
directory structure in the registry.
Here the code :
package com.msi.intaller;
import java.util.Iterator;
import ca.beq.util.win32.registry.RegistryKey;
import ca.beq.util.win32.registry.RootKey;
public class RegistryFinder {
public static void main(String... args) throws Exception
{
RegistryKey.initialize(RegistryFinder.class.getResource("jRe
gistryKey.dll").getFile());
RegistryKey key = new RegistryKey(RootKey.HKLM,
"Software\\ODBC");
for (Iterator
Can a class declared as private be accessed outside it’s package?
What is the purpose of using the java bean?
What is meant by memory leak?
How many types of assembly languages are there?
Are generics important java?