George John has Published 1081 Articles

Get the list of all the public methods in Java

George John

George John

Updated on 25-Jun-2020 14:05:34

6K+ Views

A list of all the public methods of a class or interface that is represented by an object are provided using the method java.lang.Class.getMethods(). The public methods include that are declared by the class or interface and also those that are inherited by the class or interface.Also, the getMethods() method ... Read More

What would getPackage() return for a class in unnamed package in Java?

George John

George John

Updated on 25-Jun-2020 14:02:36

282 Views

The package for a class can be obtained using the java.lang.Class.getPackage() method with the help of the class loader of the class.The getPackage() method returns null for a class in unnamed package. A program that demonstrates this is given as follows −Example Live Democlass Class1 {    public class Main { ... Read More

Get super class of an object in Java

George John

George John

Updated on 25-Jun-2020 13:52:19

732 Views

The immediate superclass of any entity such as an object, class, primitive type, interface etc. can be obtained using the method java.lang.Class.getSuperclass(). This method contains no parameters.A program that demonstrates this is given as follows −Example Live Demopublic class Main {    public static void main(String[] args) {       ... Read More

MySQL sort string number?

George John

George John

Updated on 25-Jun-2020 13:50:11

1K+ Views

To sort string number, use the CAST() function from MySQL. The syntax is as follows −SELECT *FROM yourTableName ORDER BY (yourColumnName as Decimal(integerValue, integerValueAfterDecimalPoint)) desc;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table SortingStringDemo -> ( ... Read More

Get the fully-qualified name of a class in Java

George John

George John

Updated on 25-Jun-2020 13:48:16

12K+ Views

A fully-qualified class name in Java contains the package that the class originated from. An example of this is java.util.ArrayList. The fully-qualified class name can be obtained using the getName() method.A program that demonstrates this is given as follows −Example Live Demopublic class Demo {    public static void main(String[] argv) ... Read More

CSS nav-down property

George John

George John

Updated on 25-Jun-2020 13:39:32

218 Views

The nav-down property is used to move down when you have pressed on down arrow button in keypad. You can try to run the following code to implement the CSS nav-down propertyExampleLive Demo                    button {         ... Read More

Validate the first name and last name with Java Regular Expressions

George John

George John

Updated on 25-Jun-2020 13:25:18

5K+ Views

In order to match the first name and last name using regular expression, we use the matches method in Java. The java.lang.String.matches() method returns a boolean value which depends on the matching of the String with the regular expression.Declaration −The java.lang.String.matches() method is declared as follows −public boolean matches(String regex)Let ... Read More

Change the Auto Increment counter in MySQL?

George John

George John

Updated on 25-Jun-2020 13:20:13

11K+ Views

In MySQL, auto increment counter starts from 0 by default, but if you want the auto increment to start from another number, use the below syntax.ALTER TABLE yourTable auto_increment=yourIntegerNumber;To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create table ... Read More

Is there any whoami function or command in MySQL like UNIX?

George John

George John

Updated on 25-Jun-2020 13:16:47

896 Views

There is no whoami function in MySQL. The whoami can be used to know the current user in UNIX. Use user() or current_user() function from MySQL for the same purpose.The following is the output.+-----------+ | version() | +-----------+ | 8.0.12    | +-----------+ 1 row in set (0.00 sec)Case 1  ... Read More

Change CSS filter property with Animation

George John

George John

Updated on 25-Jun-2020 13:13:26

328 Views

To implement animation on filter property with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 600px;             height: 300px;           ... Read More

Advertisements