Skip to main content

Basic Core Java Interview Questions | Core java | Java Questions | Core Basics | Interview Questions | Java Questions | Core Java Basics | OOP in java | Object oriented programming | Object oriented programming in java

Basic Core Java Interview Questions | Core java | Java Questions | Core Basics | Interview Questions | Java Questions | Core Java Basics | OOP in java | Object oriented programming | Object oriented programming in java

1. What is OOP?
A. OOP extends for Object oriented programming. It is a paradigm of programming which works on object. In object oriented programming everything is in the form of          object. In java except primitives everything in the form of object. For converting primitives to object we can use wrapper classes concept in java.

2. What is Abstraction?
A. Abstraction is nothing but hiding the internal implementation and showing some set of services to the end user is called abstraction.

3. How can we use abstraction in java?
A. We can use abstraction in java with the help of Interface and Abstract class.

4. What is Abstract class?
A. Abstract class is special type of class which is declared by abstract keyword and used to achieve abstraction. It can't be instantiated(Object not created). It contains    
     abstract methods and non-abstract methods. We can define final block in abstract class. We can declare and define variables in abstract class. Abstract class also            contains constructors.    

5. What is interface?
A. Interface is a same as the java class but it is declared by interface keyword and it is used to achieve fully abstraction in java. We can not declare a variable in interface we have to define(provide a value to the variable) that variable. The variables which is define in interface are by default Public, Static and Final. It contains only Abstract methods upto java 7. It can't be instantiate. Interface does not contain constructors.

6. What is Inheritance?   
A. When child class aquire all the properties of perent class then it is called inheritance. It is also called IS-A relationship. For achiving inheritence throw class we use
     extends keyword. And inheritance concept is used for code reusability. 

7. What is static?
A. Static means one time initialisation. Static in java is keyword. We can use static keyword with block, variable, methods , inner classes. 

8.  What is super ?
A. Super is a keyword which is used to access parent  class property in java. 

9. Why we use this keyword in java?
A. this referce to current class propery so we use for accessing current class property.

10. Types of variables in java?
A. There are 3 types of variables in java.

    1) Local variable   2) Instance  variable   3) Class variable

  




Comments

Popular posts from this blog

most importent core java interview questions and answers

   Most Important Core  Java Interview Questions &  Answers for fresher and experience both 1. What is java? A. java is object oriented programing language which is invented by james gosling in 1995. first version of java is called oak but after that its name was changed with java. 2. What are the features of java? A. There are some features of java :    (a) Platform independent.   (b) Object Oriented Programming Language.   (c) Strongly-typed Programming Language.   (d) Interpreted and Compiled Language.   (e) Automatic Memory Management. 3.What is mean by  Platform independent ? A. Java is plateform independent because java uses JVM ( java virtual machine for run the      bytecode wich is generated by java compiler ) and JVM is plateform dependent so every     java code after compilation it ganerates bytecode wich is pateform independ...

Core java collection framework interview questions and answers second part...

                                            1: which classes of collection framework that takes only homogeneous (same type) objects only. Ans: Only there are two classes that takes homogeneous elements those are TreeSet and TreeMap.                                                   2: How ArrayList work's internally? Ans:             Example :       ArrayList :     | 1 | 5 | 6 | 9 | 4 | 5 | 2 | 11 |      Size : 8      index : 0 - 7 arraylist is same as an array but it's dynamic array so, it increases it's size when required.    when you create a arraylist object initially it's size will be 10, and as you inter any value that  will go in in in...

Java Inheritance

#Java Inheritance Interview Questions      #inheritance | #multilelelinheritance | #single inheritance | #javainheritance | #oppsinheritance |     #java  | #OOps | #corejava | #corejavainheritance | #java inheritance | #coreinheritance |   #oopjavainheritance   1: What is inheritance?   A: Inheritance is the most important feature in any object-oriented programming language, This is a                child-parent relationship that allows as to reuse the same logic or same code in a specific manner.   2: How many types of inheritance are supported by java? A:  4 types of inheritance are supported by java,           Single-Level, Multi-Level, Hierarchical, Multiple. Note: In java multiple inheritance, we can achive through Interface.                                   ...