Why Abstract Class is used in Java?

Rishi Raj
Updated on 30-Jul-2019 22:30:24
A class is an abstract class if it contains at least one abstract method. It can contain other non-abstract methods as well. A class can be declared as abstract by using the abstract keyword. Also, an abstract class cannot be instantiated.A program that demonstrates an abstract class in Java is given as follows:Example Live Demoabstract class Animal {    abstract void sound(); } class Cat extends Animal {    void sound() {       System.out.println("Cat Meows");    } } class Dog extends Animal {    void sound() {       System.out.println("Dog Barks");    } } class Cow extends Animal ... Read More

Why do our eyelashes and eyebrows does not grow continuously?

Vandana Rao
Updated on 30-Jul-2019 22:30:24
A roughly 90% of your hair follicles are normally in the development stage at any specified point. The hair in your eyebrows just goes through a short-term length, approximately 4 months. The length of your hair is normally perfect before expected time which it has to grow.Hair follicles have staged growth cycles: one stage for growth, one stage for the lapse and one stage for rest. A roughly 90% of your hair follicles are generally in the development stage at any specified point. The hair in your eyebrows just goes through a short-term cycle length, approximately 4 months in contrast ... Read More

Journalists who report Fake news will lose their accreditation !!

Prasanna Kotamraju
Updated on 30-Jul-2019 22:30:24
Nowadays we read so much news online, especially in our social media, we get confused which is genuine and which is a hoax. There is a whole lot of fake news which is created and circulated deliberately to grab the attention of readers and draw views. Many news may appear to be true but can be very distractive and dangerous too.Usually, these stories are created to influence people in a wrong way or to grab public attention and divert them from reality. Most of the fake news is propagated by political parties to grab publicity and cause political infusion.It is ... Read More

Get last value in Java TreeSet

Samual Sam
Updated on 30-Jul-2019 22:30:24
To get the last value in TreeSet, use the last() method.First, get the TreeSet and add elements to it −TreeSet tSet = new TreeSet(); tSet.add("10"); tSet.add("20"); tSet.add("30"); tSet.add("40"); tSet.add("50"); tSet.add("60");Now, get the first value −tSet.last()The following is an example to get the last value in TreeSet −Example Live Demoimport java.util.*; public class Demo {   public static void main(String args[]){ TreeSet tSet = new TreeSet(); tSet.add("10"); tSet.add("20"); tSet.add("30"); ... Read More

Why is Yoga known as a spiritual connection between God and Human?

Knowledge base
Updated on 30-Jul-2019 22:30:24
Yoga is not just a physical exercise but a way of living. Today yoga is mostly being practiced for physical fitness, stamina, and weight-loss. But it is not just that. Practicing Yoga is actually a path to spiritual knowledge. Yoga facilitates inner peace, self-realization, and mental purification.Yoga has various benefitsThere are different types of Yoga such as Hatha yoga, Tantra yoga, Gyan yoga. Kriya yoga, Raja yoga, Kundalini yoga, Sankhya yoga, Tattwa yoga etc. Each of them has specific benefits, such as Gyan Yoga offers you the path of self-knowledge, while Hatha yoga brings you the data regarding body postures ... Read More

Which oil is better for cooking, mustard oil or coconut oil?

Ridhi Arora
Updated on 30-Jul-2019 22:30:24
It is imperative that the Cooking Oil one uses should be healthy enough so that it provides our body with essential nutrients. In the light of this, let's discuss which out of mustard oil or coconut oil is better for cooking.First of all, it is imperative to know that any oil that one must intake should be dependent upon which region of the country you belong to. For people living in the Southern part of India, coconut oil is better while for those living in North India mustard oil is a better choice. This is because South India has ample ... Read More

What does Interface consist of in Java

Jai Janardhan
Updated on 30-Jul-2019 22:30:24
An interface can be defined using the interface keyword. It contains variables and methods like a class but the methods in an interface are abstract by default unlike a class. An interface is primarily used to implement abstraction and it cannot be instantiated.A program that demonstrates an interface in Java is given as follows:Example Live Demointerface AnimalSound {    abstract void sound(); } class CatSound implements AnimalSound {    public void sound() {       System.out.println("Cat Sound: Meow");    } } class DogSound implements AnimalSound {    public void sound() {       System.out.println("Dog Sound: Bark");    } } ... Read More

How to multiple insert or batch insert at a time in MySQL query?

George John
Updated on 30-Jul-2019 22:30:24
You need to use VALUES() with comma separation for multiple insert or batch insert at a time. Use the following syntax that does not produce an invalid MySQL query on insert. The syntax is as follows:INSERT INTO yourTableName VALUES(yourValue1), (yourValue1), (yourValue2), (yourValue3), (yourValue4), (yourValue5), .......N;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table addMultipleValues    -> (    -> Counter int NOT NULL    -> ); Query OK, 0 rows affected (0.60 sec)Now you can insert batch records in the table using VALUES() with comma separation. The query ... Read More

World Autism Awareness Day 2nd April 2018: Is Autism curable?

Prasanna Kotamraju
Updated on 30-Jul-2019 22:30:24
On this World Autism Awareness Day, let us get some awareness about this disorder. Research says premature infants with less birth weight are suffering 5 times more with this disorder.Sadly there is little awareness about this health condition and there are fewer efforts to fight this condition. Surprisingly very few people ever understand this condition to the core. In the world, one in every 68 children is suffering from this. Boys are more prone to Autism than girls.Autism can occur early − Autism can occur in children as young as 12 months but can be diagnosed only when once the ... Read More

How can I describe all tables in the database through a single statement in MySQL?

Ankith Reddy
Updated on 30-Jul-2019 22:30:24
You can use INFORMATION_SCHEMA.COLUMNS to describe all tables in database through a single statement. The syntax is as follows.SELECT *FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=’yourDatabaseName’\GHere I am using my database sample with two tables.The table names are as follows −mytableyourtableImplement the above syntax for your database. The query is as follows −mysql> select * FROM information_schema.columns WHERE table_schema = 'sample'\GThe following is the output describing the two tables in our database.*************************** 1. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sample TABLE_NAME: mytable COLUMN_NAME: id ORDINAL_POSITION: 1 COLUMN_DEFAULT: NULL IS_NULLABLE: YES DATA_TYPE: int CHARACTER_MAXIMUM_LENGTH: NULL CHARACTER_OCTET_LENGTH: NULL NUMERIC_PRECISION: 10 NUMERIC_SCALE: 0 DATETIME_PRECISION: NULL CHARACTER_SET_NAME: NULL ... Read More