What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-24 22:00:15
static vs instance
static or class method 1) A method that is declared as static is known as the static method 2) We don't need to create the objects to call the static methods 3) Non-static (instance) members cannot be accessed in static context (static method, static blo... Add solution -
Other 2021-11-15 05:23:21
constructors vs blocks
constructor: instance of the class. private constructor (Driver class) ==> singleton class constructor can only be called within another constructor constructor will be executed when the object is created can be overloaded cannot be ... Add solution -
Java 2021-11-08 04:00:18
static methods vs instance methods
static or class method 1) A method that is declared as static is known as the static method 2) We don't need to create the objects to call the static methods 3) Non-static (instance) members cannot be accessed in static context (static method, static blo... Add solution -
Other 2021-10-24 00:23:07
where do you implement static block in framework
Static Block: I use static block in DBUtilities class. See below... static { try { connection = DriverManager.getConnection(url, username, password); statement = connection.createStatement(); metadata = connection.g... Add solution -
Java 2021-10-17 21:53:05
abstraction example in java
bstraction: Hiding the implementation details, concentrating on essentials things, without worrying about the details ■ In java, abstraction is achieved via abstract class or interface ■ Abstraction cannot exist without inheritance 3.1. Abstract cla... Add solution -
Other 2021-10-08 18:40:11
Local Variable and Instance Variable?
First is declaration. Local variable has to be in the block. it can be static block or main method block. If it is declared in the class not in the block, then it is Instance variable. Instance variable has a default value is ZERO. Local variable if ... Add solution -
Other 2021-10-01 01:31:09
Static and Instance Variable?
Different is number of the copies are different. Instance are belongs to object from one class you can have multiple objects. If u have multiple objects and if you want to each of the object a own value that is time you need to use instance variable. I... Add solution -
Other 2021-09-19 15:01:04
instance methods
static or class method 1) A method that is declared as static is known as the static method 2) We don't need to create the objects to call the static methods 3) Non-static (instance) members cannot be accessed in static context (static method, static blo... Add solution