click below
click below
Normal Size Small Size show me how
Java Fundmentals
Basic questions and deep learning.
| Combination of Both. | |
|---|---|
| What is Java? | Java is a platform independent that compiles once and runs anywhere. It is also a Strongly Typed language that follows the 4 pillars of OOP |
| What is an Object? | Are reusable software components that can be represented as attributes and behavior. Instance of a class. |
| What is a Class? | A blueprint for the object that able to instantiate the objects. Once per blueprint. |
| How do you instantiate an Object? | By the new keyword followed by the name of the Object() |
| What are some access modifiers? | Public, Private, Protected and Default. |
| What is Encapsulation? | Encapsulation is hiding the classes which encases their attributes and methods of the objects. Shouldn't allow others to view the implementation details. |
| What are variables? | They are the attributes of a class that describes information. |
| What is a static key word? | Best used as a memory management. It can be applied to Variables, Methods |
| What does a static variable do? | A variable that only mention once in the heap but can be called upon many times. Changed |
| What does Public modifier do? | Public keyword set the class, method, variable open to any part of the program to use. |
| What does the Private modifier do? | Private keyword that set the class restrictive to their own class or method scope. |
| What are the difference between JDK, JRE and JVM | Java Runtime Environment which is the minimum requirements for executing java application. Java Virtual Machine is platform independent due to compiling java bytecode used anywhere. Java Dev Kit contains... |
| Interfaces | Contains abstract methods which a class implements interface must use the methods it provides. |
| Abstract class | An Abstract class cannot instantiate objects. as they are incomplete. Sub-classes must contain missing piece to become a concrete class. It may have abstract and non-abstract methods. |
| Abstract method | Do not provide implementation and cannot contain constructors or static method. Constructors are not inherited and static method cannot be overridden. |
| What is a concrete class? | It is a full implementation of it's class blueprint. |
| What are constructors. | Must follow the same name as a class and initializes an object when created using no arguments or parameterized. |
| Can constructors be overloaded or Overridden? | Constructors are not inherited which cannot be overridden. They can be overloaded by have different amount of parameters. |
| Can Constructors be private? | constructors can be private but only initialized inside of it own class known as a singleton. |
| What is a singleton in Java? | A class that can only have one object instance at a time. If we do try instantiate a new singleton class it will refer back to the first. Constructor is private. |
| what is Final, Finally and Finalize? |