Nishtha Thakur has Published 387 Articles

How to prevent class inheritance in C++

Nishtha Thakur

Nishtha Thakur

Updated on 11-Dec-2024 09:52:41

2K+ Views

Here we will see how to prevent inheritance in C++. The concept of preventing inheritance is known as the final class. In Java or C#, we can use final classes. In C++ there are no such direct ways. Here we will see how to simulate the final class in C++. ... Read More

How to set preferred size for BoxLayout Manager in Java?

Nishtha Thakur

Nishtha Thakur

Updated on 29-Oct-2024 00:37:55

2K+ Views

In this article, we will learn to set the preferred size for a panel within a JFrame using the BoxLayout manager in Java Swing. By setting the preferred and maximum size for the panel, we can control the layout’s appearance, ensuring that the panel maintains a consistent size as other ... Read More

Uninitialized primitive data types in C/C++

Nishtha Thakur

Nishtha Thakur

Updated on 27-Aug-2020 13:56:42

362 Views

One of the most frequent question is what will be the value of some uninitialized primitive data values in C or C++? Well the answer will be different in different systems. We can assume the compiler will assign 0 into the variables. It can be done for integer as 0, ... Read More

Use CSS max-width property responsive for video player

Nishtha Thakur

Nishtha Thakur

Updated on 04-Jul-2020 06:18:01

612 Views

You can try to run the following code to use a max-width property to make your video player responsive −ExampleLive Demo                          video {             max-width: 100%;             height: auto;          }                                                     To check the effect, you need to resize the browser.    

How to make an Android status bar notification persist across phone reboot?

Nishtha Thakur

Nishtha Thakur

Updated on 03-Jul-2020 11:54:06

595 Views

This example demonstrate about How to make an Android status bar notification persist across phone rebootStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step ... Read More

CSS grid-template-columns property

Nishtha Thakur

Nishtha Thakur

Updated on 03-Jul-2020 08:05:30

84 Views

The grid-template-columns property is used to set the number of columns in the Grid.ExampleYou can try to run the following code to implement the grid-template-columns property −Live Demo                    .container {             display: grid;   ... Read More

Role of CSS flex-wrap property no-wrap value

Nishtha Thakur

Nishtha Thakur

Updated on 03-Jul-2020 07:45:12

268 Views

Use the flex-wrap property with nowrap value to avoid flex-items to wrap.ExampleYou can try to run the following code to implement the nowrap value −Live Demo                    .mycontainer {             display: flex;         ... Read More

CSS animation-duration property

Nishtha Thakur

Nishtha Thakur

Updated on 02-Jul-2020 09:22:55

103 Views

Use the animation-duration property to set how long an animation should take to complete one cycleExampleYou can try to run the following code to implement the animation-duration property −Live Demo                    div {             width: ... Read More

How to use thread.sleep() in android?

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jun-2020 14:56:28

5K+ Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use thread.sleep() in android.Step 1 − Create a new project in Android Studio, go to File ⇒ ... Read More

Example to create a table with all datatypes in MySQL using JDBC?

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jun-2020 14:07:49

1K+ Views

Java provides supporting classes/datatypes to store all the MySQL datatypes, following is the table which list outs the respective java types for MySQL datatypes −MySQL TypeJava TypeCHARStringVARCHARStringLONGVARCHARStringNUMERICjava.math.BigDecimalDECIMALjava.math.BigDecimalBITbooleanTINYINTbyteSMALLINTshortINTEGERintBIGINTlongREALfloatFLOATdoubleDOUBLEdoubleBINARYbyte []VARBINARYbyte []LONGVARBINARYbyte []DATEjava.sql.DateTIMEjava.sql.TimeTIMESTAMPjava.sql.TiimestampExampleFollowing JDBC program creates a table with name sample with all the possible datatypes in MySQL −import java.sql.Connection; import java.sql.DriverManager; import ... Read More

1 2 3 4 5 ... 39 Next
Advertisements