How can a class be accessed, If no access modifiers are
declared?
Answers were Sorted based on User's Feedback
Answer / ranganathkini
If a class is marked with no access modifiers then it is
given "package" access by default which means it can be
instantiated or subclasses by other classes in the same
package but it is inaccessible to classes outside the same
package.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ravikiran(aptech mumbai)
the default access will be resticted to the classes with in
the same package
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / babu
If a there is no access modifier specified to a class then it
takes the access modifier as Default modifier.Default Access modifier scope is package scope.so this class scope also package scope to access the classes which is having in the same package.
Is This Answer Correct ? | 0 Yes | 0 No |
What is nan inf?
Explain how to convert any java object into byte array.
Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.
which one the better thread emplemented thread or extended ?
Why can't we make jsp as a controller and action servlet in struts?
why not override thread to make a runnable? : Java thread
I want to store more than 10 objects in a remote server? Which methodology will follow?
How do you override a method in java?
What is javac used for?
Explain abstract class in java?
What are File and RandomAccessFile classes?
What is java autoboxing?