Core Java Multiple Choice Questions And Answers
Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:
List of Programming Full Forms
- Run
- Import
- Default
- Implements
7. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access modifier that will accomplish this objective?
- Public
- Private
- Protected
- Transient
- No access modifier is qualified
- String name= File.getParentName("file.txt");
- String name= (new File("file.txt")).getParent();
- String name = (new File("file.txt")).getParentName();
- String name= (new File("file.txt")).getParentFile();
- Directory dir=(new File ("file.txt")).getParentDir(); String name= dir.getName();
- new DataOutputStream("out.txt");
- new DataOutputStream(new File("out.txt"));
- new DataOutputStream(new Writer("out.txt"));
- new DataOutputStream(new FileWriter("out.txt"));
- new DataOutputStream(new OutputStream("out.txt"));
- new DataOutputStream(new FileOutputStream("out.txt"));