Nishtha Thakur

Nishtha Thakur

398 Articles Published

Articles by Nishtha Thakur

Page 18 of 40

Remove shadow of an element in Bootstrap 4

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 2K+ Views

Use the .shadow-none class in Bootstrap to remove shadow.You can try to run the following code to remove an element’s shadow −Example           Bootstrap Example                                                      Learning          Learn Tutorials for free          Play Quiz and check your knowledge          

Read More

How to prevent class inheritance in C++

Nishtha Thakur
Nishtha Thakur
Updated on 11-Dec-2024 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++. Approach Firstly, we will create one extra class called MakeFinalClass (its default constructor is private). This function is used to solve our purpose. The main Class MyClass can call the constructor of the MakeFinalClass as they are friend classes. One thing ...

Read More

Structure vs class in C++

Nishtha Thakur
Nishtha Thakur
Updated on 03-Dec-2024 349 Views

In C++ the structure and class are basically the same. But there are some minor differences. These differences are like below. The class members are private by default, but members of structures are public. Let us see these two codes to see the differences. Example Code for Class Here is the following code for the class. #include using namespace std; class my_class {   public:  int x = 10; }; int main() {  my_class my_ob;  cout

Read More

How to set preferred size for BoxLayout Manager in Java?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Oct-2024 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 components are added. This approach is useful when arranging elements vertically or horizontally in a structured format while having specific size requirements. Steps to set preferred size for BoxLayout Manager The following are the steps for setting the preferred size for BoxLayout Manager in Java − ...

Read More

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

Nishtha Thakur
Nishtha Thakur
Updated on 03-Jul-2020 603 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 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add ...

Read More

How to use thread.sleep() in android?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 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 ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken edittext and textview. When user enter some text into edittext, it going to wait till 5000ms ...

Read More

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

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 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 java.sql.Statement; public class CreatingTable_AllDatatypes {    public static void main(String args[])throws Exception {       //Registering the Driver       DriverManager.registerDriver(new com.mysql.jdbc.Driver());       //Getting the connection       String mysqlUrl = "jdbc:mysql://localhost/sampledatabase";       Connection con = DriverManager.getConnection(mysqlUrl, "root", "password");       System.out.println("Connection ...

Read More

How to use string Builder class in android?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 2K+ Views

Before getting into an example, we should know what string builder is. StringBuilder class is used to create a mutable string and it is not thread safe so multiple thread can access string builder class at a time. This example demonstrate about How to use string Builder class in android.Step 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.                             In the ...

Read More

How to use compare string in android?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 2K+ Views

This example demonstrate about How to use compare string in android.Step 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.                     In the above code, we have taken edittext, button and textviews. When user click on button, it will take the data from edittext and manipulate with string with string comparing techniques. The result of manipulation data append to textview’sStep 3 − Add the following code ...

Read More

How to get getAllStackTraces of current thread in android?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 356 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 get getAllStackTraces of current thread in android.Step 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.     In the above code, we have taken textview. It contains information about current thread stack trace.Step 3 − Add the following code to src/MainActivity.javapackage ...

Read More
Showing 171–180 of 398 articles
« Prev 1 16 17 18 19 20 40 Next »
Advertisements