0 votes
45 views
in Discuss by (98.9k points)
edited
  1. What is JAVA?


    Answer: Java is a high-level programming language and is platform-independent.


    Java is a collection of objects. It was developed by Sun Microsystems. There are a lot of applications, websites, and games that are developed using Java.


  2. What are the features of JAVA?


    Answer:

    Features of Java are as follows:

    OOP concepts Object-oriented Inheritance Encapsulation Polymorphism Abstraction

    Platform independent: A single program works on different platforms without any modification.

    High Performance: JIT (Just In Time compiler) enables high performance in Java. JIT converts the bytecode into machine language and then JVM starts the execution.

    Multi-threaded: A flow of execution is known as a Thread. JVM creates a thread which is called the main thread. The user can create multiple threads by extending the thread class or by implementing the Runnable interface.


  3. How does Java enable high performance?


    Answer: Java uses Just In Time compiler to enable high performance. It is used to convert the instructions into bytecodes.


  4. Name the Java IDE’s?

    Answer: Eclipse and NetBeans are the IDE’s of JAVA.


  5. What do you mean by Constructor?


    Answer: Constructor can be explained in detail with enlisted points:


    When a new object is created in a program a constructor gets invoked corresponding to the class. The constructor is a method which has the same name as the class name.

    If a user doesn’t create a constructor implicitly a default constructor will be created.

    The constructor can be overloaded.

    If the user created a constructor with a parameter then he should create another constructor explicitly without a parameter.


  6. What is meant by the Local variable and the Instance variable?


    Answer:

    Local variables are defined in the method and scope of the variables that exist inside the method itself.


    Instance variable is defined inside the class and outside the method and the scope of the variables exists throughout the class.


  7. What is a Class?


    Answer: All Java codes are defined in a Class. It has variables and methods.


    Variables are attributes which define the state of a class.


    Methods are the place where the exact business logic has to be done. It contains a set of statements (or) instructions to satisfy the particular requirement.

  8. What is an Object?


    Answer: An instance of a class is called an object. The object has state and behavior.


    Whenever the JVM reads the “new()” keyword then it will create an instance of that class.


  9. What are the OOPs concepts?


    Answer: OOPs concepts include:


    Inheritance Encapsulation Polymorphism Abstraction Interface


  10. What is Inheritance?


    Answer: Inheritance means one class can extend to another class. So that the codes can be reused from one class to another class. The existing class is known as the Super class whereas the derived class is known as a sub class.


  11. What is Encapsulation?


    Answer: Purpose of Encapsulation:


    Protects the code from others. Code maintainability.

  12. What is Polymorphism?


    Answer: Polymorphism means many forms.


    A single object can refer to the super-class or sub-class depending on the reference type which is called polymorphism.


  13. What is meant by Method Overriding?


    Answer: Method overriding happens if the sub-class method satisfies the below conditions with the Super-class method:


    Method name should be the same The argument should be the same Return type should also be the same

    The key benefit of overriding is that the Sub-class can provide some specific information about that subclass type than the super-class.

Your answer

Please answer the question in detail

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

Related questions

0 votes
1 answer 128 views
0 votes
1 answer 87 views
+1 vote
0 answers 48 views
0 votes
1 answer 97 views
asked Jul 9, 2022 in Discuss by Doubtly (98.9k points)
0 votes
1 answer 6.3k views
0 votes
1 answer 124 views
asked Aug 9, 2022 in Discuss by Doubtly (98.9k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

537 users

...