Is it necessary that each try block must be followed by a catch block?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

How to sort an array in java without using sort method?

0 Answers  


why we need this (1.object,2.class,3.data hiding,4.encapsulation,5.abstraction,6. polymorphism,7.inheritance)

2 Answers  


What is difference between static variable and global variable?

0 Answers  


What is the default initialized value of a boolean type variable?

3 Answers  


If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?

5 Answers  






what are the high-level thread states? : Java thread

0 Answers  


Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?

0 Answers   HCL,


where do you place after you did code in java

2 Answers  


How can you avoid serialization in child class if the base class is implementing the serializable interface?

0 Answers  


What is an exception?

6 Answers  


84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.

1 Answers  


What is garbage collection? What is the process that is responsible for doing that in java?

0 Answers  


Categories