java aptitude questions and answers for freshers Top MNC Companies TCS, WIPRO, Accenture, and Infosys

By | February 15, 2017

java aptitude questions and answers for freshers Top MNC Companies TCS, WIPRO, Accenture, and Infosys

java aptitude questions and answers for freshers Top MNC Companies TCS, WIPRO, Accenture, and InfosysCore Java Frequently Asked Real Time Interview Questions and Answers for Freshers – 2017 and java aptitude test questions and answers freshersJava Frequently Asked Interview Questions and Answers for Freshers

  What Is Use Of A Abstract Variable?

Variables can’t be declared as abstract. only classes and methods can be declared as abstract.

  Can You Create An Object Of An Abstract Class?

Not possible. Abstract classes can’t be instantiated.

  Can A Abstract Class Be Defined Without Any Abstract Methods?

Yes it’s possible. This is basically to avoid instance creation of the class.

  Class C Implements Interface I Containing Method M1 And M2 Declarations. Class C Has Provided Implementation For Method M2. Can I Create An Object Of Class C?

No not possible. Class C should provide implementation for all the methods in the Interface I. Since Class C didn’t provide implementation for m1 method, it has to be declared as abstract. Abstract classes can’t be instantiated.




  Can A Method Inside A Interface Be Declared As Final?

No not possible. Doing so will result in compilation error. public and abstract are the only applicable modifiers for method declaration in an interface.

  Can An Interface Implement Another Interface?

ntefaces doesn’t provide implementation hence a interface cannot implement another interface.

  Can An Interface Extend Another Interface?

Yes an Interface can inherit another Interface, for that matter an Interface can extend more than one Interface.

  Can A Class Extend More Than One Class?

Not possible. A Class can extend only one class but can implement any number of Interfaces.




  Why Is An Interface Be Able To Extend More Than One Interface But A Class Can’t Extend More Than One Class?

Basically Java doesn’t allow multiple inheritance, so a Class is restricted to extend only one Class. But an Interface is a pure abstraction model and doesn’t have inheritance hierarchy like classes(do remember that the base class of all classes is Object). So an Interface is allowed to extend more than one Interface.

  Can An Interface Be Final?

Not possible. Doing it will result in compilation error.

  Can A Class Be Defined Inside An Interface?

Yes it’s possible.

  Can An Interface Be Defined Inside A Class?

Yes it’s possible.

  What Is A Marker Interface?

An Interface which doesn’t have any declaration inside but still enforces a mechanism.




  Which Oo Concept Is Achieved By Using Overloading And Overriding?

Polymorphism.

  If I Only Change The Return Type, Does The Method Become Overloaded?

No it doesn’t. There should be a change in method arguements for a method to be overloaded.

  Why Does Java Not Support Operator Overloading?

Operator overloading makes the code very difficult to read and maintain. To maintain code simplicity, Java doesn’t support operator overloading.

  Can We Define Private And Protected Modifiers For Variables In Interfaces?

No

  What Is Externalizable?

Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in)

  What Modifiers Are Allowed For Methods In An Interface?

Only public and abstract modifiers are allowed for methods in interfaces.




  What Is A Local, Member And A Class Variable?

Variables declared within a method are “local” variables. Variables declared within the class i.e not within any methods are “member” variables (global variables). Variables declared within the class i.e not within any methods and are defined as “static” are class variables.

Previous Page (20-40)          Current Page (40-60)           Next Page (60-80)

 

 

java aptitude questions and answers for freshers Top MNC Companies TCS, WIPRO, Accenture, and Infosys




java aptitude questions and answers for freshers Top MNC Companies TCS, WIPRO, Accenture, and Infosys

One thought on “java aptitude questions and answers for freshers Top MNC Companies TCS, WIPRO, Accenture, and Infosys

  1. Pingback: Java Aptitude Test Interview questions and answers for freshers 2017 Top MNC Companies Mindtree, WIPRO, Accenture, and Infosys - Today News Update

Leave a Reply

Your email address will not be published. Required fields are marked *