Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by George John
Page 34 of 79
Get the fully-qualified name of a class in Java
A fully-qualified class name in Java contains the package that the class originated from. An example of this is java.util.ArrayList. The fully-qualified class name can be obtained using the getName() method.A program that demonstrates this is given as follows −Examplepublic class Demo { public static void main(String[] argv) throws Exception { Class c = java.util.ArrayList.class; String className = c.getName(); System.out.println("The fully-qualified name of the class is: " + className); } }OutputThe fully-qualified name of the class is: java.util.ArrayListNow let us understand the above program.The getName() method is used to ...
Read MoreSort subset of array elements in Java
The java.util.Arrays.sort() method can be used to sort a subset of the array elements in Java. This method has three arguments i.e. the array to be sorted, the index of the first element of the subset (included in the sorted elements) and the index of the last element of the subset (excluded from the sorted elements). Also, the Arrays.sort() method does not return any value.A program that demonstrates this is given as follows −Exampleimport java.util.Arrays; public class Demo { public static void main(String[] args) { int arr[] = { 1, 9, 7, 3, 2, 8, 4, ...
Read MoreC++ Program to Swap Numbers in Cyclic Order Using Call by Reference
Three numbers can be swapped in cyclic order by passing them to a function cyclicSwapping() using call by reference. This function swaps the numbers in a cyclic fashion.The program to swap numbers in cyclic order using call by reference is given as follows −Example#include using namespace std; void cyclicSwapping(int *x, int *y, int *z) { int temp; temp = *y; *y = *x; *x = *z; *z = temp; } int main() { int x, y, z; cout > y >> z; cout
Read Moregetchar_unlocked() in C
The function getchar_unlocked() is deprecated in Windows because it is a thread unsafe version of getchar(). It is suggested not to use getchar_unlocked(). There is no stream lock check that’s why getchar_unlocked is unsafe. The function getchar_unlocked() is faster than getchar().Here is the syntax of getchar_unlocked() in C language,int getchar_unlocked(void);A program of getchar_unlocked() in C is as follows −Example#include int main() { char val; val = getchar_unlocked(); printf("Enter the character : "); printf("Entered character : %c", val); return 0; }OutputHere is the outputEnter the character : a Entered character : a
Read Moresr-only Bootstrap class
Hide an element to all devices except screen readers with the class .sr-only.You can try to run the following code to implement the sr-only Bootstrap −Example Bootstrap Example Email address Password
Read MoreSet disabled state for Bootstrap Buttons
To set disabled state, use the disabled class.You can try to run the following code for the disabled state of a button −Example Bootstrap Example The following are some buttons: Default Button Disabled Button
Read MoreBootstrap progress-bar class
Use the progress-bar class in Bootstrap to create a progress bar.You can try to run the following code to implement progress-bar class in Bootstrap −Example Bootstrap Example 70% Complete
Read MoreUsage of btn-xs Bootstrap class
Create an extra small button using the btn-xs Bootstrap class. You can try to run the following code to implement the btn-xs class:Example Bootstrap Example Subject Programming Web Dev Database Networking
Read MoreChange the size of Bootstrap input groups
Change the size of the input groups, by adding the relative form sizing classes like .input-group-lg, input-group-sm, input-group-xs to the .input-group itself.You can try to run the following code to change the size of input groups in Bootstrap:Example Bootstrap Example @ @ @
Read MoreSet large modal in Bootstrap
Use the .modal-lg class in Bootstrap to set large modal with more width.You can try to run the following code to set large modal;Example Bootstrap Example Examination Result × Warning If JavaScript isn't enabled in your web browser, then you may not be able to see the result. Close
Read More