what are the uses of Class class and what it returns?
explain it with the example code.
Answer / santhosh kv
we can use class "Class" for dynamic class loading.
ie Class.forName("classname");
| Is This Answer Correct ? | 3 Yes | 0 No |
import java.io.*; class Demo { public static void main(String args[]) { File f=new File("1234.msg"); String arr[]=f.list(); System.out.println(arr.length); } }
Explain about main thread in java?
What is the purpose of a statement block?
Are floats faster than doubles?
How will you load a specific locale?
11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result? 1 B 2 The code runs with no output. 3 Compilation fails because of an error in line 12. 4 Compilation fails because of an error in line 15.
Do you need to import math in java?
wat is class level lock and object level lock
What are the types of arrays in java?
Which are different kinds of source code?
What is the difference between class & object?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?