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
- The elements in the collection are ordered.
- The collection is guaranteed to be immutable.
- The elements in the collection are guaranteed to be unique.
- The elements in the collection are accessed using a unique key.
- The elements in the collections are guaranteed to be synchronized.
Given:
switch (i)
{
default:
System.out.printIn("Hello");
}
- Char
- Byte
- Float
- Double
- Object
public class foo
{
public static void main (string[]args)
{
try
{
return;
}
finally
{
system.out.printIn("Finally");
}
}
}
- The program runs and prints nothing.
- The program runs and prints "Finally"
- The code compiles, but an exception is thrown at runtime.
- The code will not compile because the catch block is missing.
- An encapsulation, public class promotes re-use.
- Classes that share the same interface are always tightly encapsulated.
- An encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.
- An encapsulated class allows programmer to change an implementation without affecting outside code.