Languages-Java [3i Infotech Placement]: Sample Questions 76 - 78 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 76

Edit

Describe in Detail

Essay▾

What are abstract class?

Explanation

Understanding of Abstract Class
  • A class that is declared with abstract keyword, is known as abstract class.
  • They are called interfaces.
  • It can abstract and non-abstract methods.
  • We cannot instantiate them, and they contain methods declared with or without an implementation.
  • In interfaces, all fields are automatically public, static and final and all methods are public.

Question 77

Edit

Describe in Detail

Essay▾

Why java is considered as platform independent?

Explanation

Understanding of Java Independent Program
  • Platform independence means that java source code can run on all operating systems.
  • Java code is written in human readable language.
  • A compiler (JIT) converts source code into executable code.
  • Java converts the source code into intermediate representation that is interpreted by virtual machine.
  • Intermediate representation in java is the java byte code.

Question 78

Edit

Describe in Detail

Essay▾

What is the difference between an abstract class and interface?

Explanation

Difference between Abstract Class and Interface
Abstract classInterface
Does not support multiple inheritanceSupports multiple inheritance
Contains data membersDoes not contain data members
Contains constructorsDoes not contain constructors
Contains both incomplete and complete membersContains only incomplete members
Access modifiers for the subs, functions, and propertiesNo access modifiers- by default everything is pubic.

Developed by: