Java Flashcards
Why use Java
It’s a rich api, portable, simple and fast to use.
What are the JDK, JRE, and the JVM.
JDK: Within the JRE. It’s the Java Development Kit and it holds the compiler.
JRE: Within the JDK. It’s the Java Runtime Environment. This holds the class library.
JVM: This is the Java Virtual Machine and it is where the code actually runs.
What’s a class?
Blueprint of an object which is an instance of a class
What ae the access modifiers and what they can access
Public
Private
Protected
Default
What are the non access modifiers
Abstract, Final, Transient, and Volatile
The types and scopes of variables in Java
Types: Static, Instance and Local
Scope: Class, Block, Instance
The data members and their sizes.
Byte - 1 Char - 2 Short - 2 Int - 4 Float - 4 Long - 8 Double - 8 Boolean - Varies
Class members in Java
Fields, Methods, constructors, inner class, interface, block
Is Java 100% OOP?
No, because of the 8 primitives
Why is the string pool necessary?
Strings are Immutable. The string pool holds all the data for the strings in a place in the heap memory so that whenever you call that string or you create a string with the same value, it won’t create more, it will merely point to that one.