radhakrishna

radhakrishna

62 Articles Published

Articles by radhakrishna

Page 6 of 7

How can we ignore the negative values return by MySQL DATEDIFF() function?

radhakrishna
radhakrishna
Updated on 29-Jan-2020 1K+ Views

As we know that DATEDIFF() function is used to get the difference in a number of days between two dates. Hence, it is quite possible that it returns negative value as well.mysql> select * from differ; +------------+-------------+ | OrderDate  | WorkingDate | +------------+-------------+ | 2017-10-22 | 2017-10-29  | | 2017-10-25 | 2017-10-30  | | 2017-10-25 | 2017-11-30  | +------------+-------------+ 3 rows in set (0.00 sec)Above query will return the values from table ‘differ’. Now, if someone wants to get the difference between OrderDate and WorkingDate then the output would be negative as follows −mysql> Select DATEDIFF(OrderDate, WorkingDate)AS 'DIFFERENCE IN DAYS' ...

Read More

How can we know about the starting range of TIMESTAMP data type with the help of MySQL FROM_UNIXTIME() function?

radhakrishna
radhakrishna
Updated on 28-Jan-2020 192 Views

As we know that this function converts a number of seconds into TIMESTAMP value. So by providing 0 seconds as the argument, it will give us the starting range of TIMESTAMP data type.mysql> Select FROM_UNIXTIME(0); +-------------------------+ | FROM_UNIXTIME(0)        | +-------------------------+ | 1970-01-01 05:30:00     | +-------------------------+ 1 row in set (0.00 sec)Now if we will change the argument from 0 to 60 seconds then the time will be changed by 01 minutes.mysql> Select FROM_UNIXTIME(60); +-------------------------+ | FROM_UNIXTIME(60)       | +-------------------------+ | 1970-01-01 05:31:00     | +-------------------------+ 1 row in set (0.00 sec)

Read More

What is super() function in JavaScript?

radhakrishna
radhakrishna
Updated on 08-Jan-2020 320 Views

Use the super() function to call the constructor of the parent class and access functions on an object's parent class. Example You can try to run the following code to implement super()               class Department {         constructor() {}         static msg() {           return 'Hello';         }       }       class Employee extends Department {         constructor() {}         static displayMsg() {           return super.msg() + ' World!';         }       }       document.write(Employee.displayMsg());        

Read More

What is the difference between non-static methods and abstract methods in Java?

radhakrishna
radhakrishna
Updated on 19-Dec-2019 2K+ Views

Following are the notable differences between non-static methods and abstract methods.Non-static (normal) methodsAbstract methodsThese methods contain a body.Abstract methods don’t have body these are ended with a semicolonYou can use normal method directly.You cannot use abstract methods directly, to use them you need to inherit them and provide body to these methods and use them.Example:public void display() {    System.out.println("Hi"); }Example:public void display();

Read More

How to detect if JavaScript is disabled in a browser?

radhakrishna
radhakrishna
Updated on 12-Sep-2019 7K+ Views

To detect if JavaScript is disabled in a web browser, use the tag. The HTML tag is used to handle the browsers, which do recognize tag but do not support scripting. This tag is used to display an alternate text message.Here’s an example,           HTML noscript Tag                                                    Your browser does not support JavaScript!          

Read More

What is the difference between comments /*...*/ and /**...*/ in JavaScript?

radhakrishna
radhakrishna
Updated on 12-Sep-2019 705 Views

/*…*/ and /**…*/ are multi-line comments. The following is a multi line comment in JavaScript./*    * This is a multiline comment in JavaScript    * It is very similar to comments in C Programming */The following example shows how to use multi-line comments in JavaScript.     The comment /** */ is for  PHPDocumentator ,  which is used to make automatic documentation.

Read More

What is the difference between Java and Core Java?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 1K+ Views

Java is a programming language, whereas Core Java is a computing platform. Java Platform Standard Edition is Core Java, which is also called Java SE. The following are the computing following supported by Java, which also has Core Java as its part:Java SE Java Standard Edition used to develop desktop applications. A well-known implementation of Java SE is the Java Development Kit (JDK).Java EE Java Enterprise Edition i.e. Java 2 Platform, Enterprise Edition or J2EE. Java EE is used for applications running on servers. Java ME Java Micro Edition is used for applications running on mobile phones.Java SE is the Standard Edition and also ...

Read More

Why can't static method be abstract in Java?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 2K+ Views

A static method belongs to class not to object instance thus it cannot be overridden or implemented in a child class. So there is no use of making a static method as abstract.

Read More

How to avoid Java code in jsp page?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 318 Views

You can use JSTL, JSP Standard Tag Library or EL, Expression Language to avoid scriptlets.

Read More

How do I write package names in Java?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 1K+ Views

While choosing a package name you need to keep the following points in mind. The name of the package should be in small letters. It is suggested to start the name of the package with the top level domain level followed by sub domains, ex: com.example.tutorialspoint. Example You can declare a package as in. package com.mypackage.tutorialspoint; Public class Sample { Public static void main(String args[]) { System.out.println("Welcome to Tutorialspoint"); } } Executing a package You need to compile the file with packages using –d ...

Read More
Showing 51–60 of 62 articles
« Prev 1 3 4 5 6 7 Next »
Advertisements