usharani

usharani

57 Articles Published

Articles by usharani

Page 6 of 6

How many packages and classes are there in Java Standard Edition 8?

usharani
usharani
Updated on 18-Feb-2020 1K+ Views

Java Standard Edition provides 14 packages namely –applet − This package provides classes and methods to create and communicate with the applets.awt− This package provides classes and methods to create user interfaces.beans− This package contains classes and methods to develop components based on java beans. io− This package contains classes and methods to read and write data standard input and output devices, streams and files.lang− This package contains the fundamental classes, methods, and, interfaces of Java language.math− This package contains classes and methods which helps you to perform arithmetic operations using the Java language.net− This package provides classes to implement ...

Read More

How does MySQL handle out of range numeric values?

usharani
usharani
Updated on 30-Jan-2020 840 Views

Handling of MySQL numeric value that is out of allowed range of column data type depends upon the SQL mode in following ways −(A) Enabled SQL strict mode - When strict SQL mode is enabled, MySQL returns the error on entering the put-of-range value. In this case, the insertion of some or all the values got failed.For example, we have created a table with two columns having TINYINT and UNSIGNED TINYINT as their data types on columns.mysql> Create table counting(Range1 Tinyint, Range2 Tinyint Unsigned); Query OK, 0 rows affected (0.14 sec)Now with the help of the following command, we enabled the ...

Read More

What MySQL returns on using any other character than 'T' or 'Space' between date and time parts?

usharani
usharani
Updated on 29-Jan-2020 126 Views

In that case, MySQL will return all zeros at the place of time along with correct date part. An example is as follows in which we used character ‘W’ at the place of ‘T’ or ‘Space’ between date and time part −mysql> Select TIMESTAMP('2017-10-20W06:10:36'); +----------------------------------+ | TIMESTAMP('2017-10-20W06:10:36') | +----------------------------------+ | 2017-10-20 00:00:00              | +----------------------------------+ 1 row in set, 1 warning (0.00 sec)

Read More

How can we provide a date with only year (zero months & zero days) value in MySQL?

usharani
usharani
Updated on 28-Jan-2020 292 Views

We can store a date with only year value and have zero months as well as zero-days in MySQL table by disabling NO_ZERO_IN_DATE mode. If this mode is enabled then MySQL will count such kind of date as invalid date and stores all zeros.mysql> Insert into year_testing (OrderDate) values('2017:00:00'); Query OK, 1 row affected (0.09 sec) mysql> select * from year_testing; +------------+ | OrderDate  | +------------+ | 2017-00-00 | +------------+ 1 row in set (0.00 sec) mysql> SET sql_mode = 'NO_ZERO_IN_DATE'; Query OK, 0 rows affected (0.00 sec) mysql> Insert into year_testing(OrderDate) values('2017:00:00'); Query OK, 1 row ...

Read More

What is the equivalent of C# namespace in Java?

usharani
usharani
Updated on 30-Jul-2019 413 Views

Packages are similar to namespaces in C#.

Read More

Why the main method has to be in a java class?

usharani
usharani
Updated on 30-Jul-2019 466 Views

Main method is the entry point of the execution in Java. When we execute a class JVM searches for the main method and execute the contents of it line by line. If you observe the following example you can compile a this program but if you try to execute it you will get an error saying “Main method not found”. Example abstract class SuperTest { public abstract void sample(); public abstract void demo(); } public class Example extends SuperTest{ public void sample(){ System.out.println("sample method ...

Read More

Is null a keyword in Java?

usharani
usharani
Updated on 30-Jul-2019 671 Views

No, null is not a keyword. Though they seem like keywords null, true and, false are considered as literals in Java.

Read More
Showing 51–57 of 57 articles
« Prev 1 2 3 4 5 6 Next »
Advertisements