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 karthikeya Boyini
Page 69 of 143
Bootstrap .btn-lg class
To make a large button, use the .btn-lg class in Bootstrap.You can try to run the following code to implement the btn-lg classExample Bootstrap Example Large button
Read MoreHow to use #undef directive in C#?
The #undef directive allows you to undefine a symbol. The following is the syntax −#undef SYMBOLFor example,#undef OneIt evaluates to false when used along with #if directive. Let us see an example −Example#define One #undef Two using System; namespace Demo { class Program { static void Main(string[] args) { #if (One && TWO) Console.WriteLine("Both are defined"); #elif (ONE && !TWO) Console.WriteLine("ONE is defined and TWO is undefined"); #elif (!ONE && TWO) Console.WriteLine("ONE is defined and TWO is undefined"); #else Console.WriteLine("Both are undefined"); #endif } } }OutputBoth are undefined
Read MoreHow to print a blank line in C#?
To display a line in C#, use the Console.WriteLine().Under that set a blank line −Console.WriteLine(" ");The following is the code that displays a blank line −Exampleusing System; namespace Program { public class Demo { public static void Main(String[] args) { Console.WriteLine(" "); Console.WriteLine("Displayed a blank line above!"); Console.ReadLine(); } } }OutputDisplayed a blank line above!
Read MoreCalling a method using null in Java
When a method is invoked on a null reference, it throws NullPointerException but in case of the static method, we can make it possible using cast expression. See the example below −Examplepublic class Tester { public static void display(){ System.out.println("display"); } private void print() { System.out.println("print"); } public static void main(String[] args) { //Scenario 1: //Calling a method on null reference //causes NullPointerException try { Tester test = null; ...
Read MoreBootstrap progress class
Use the .progress class in Bootstrap to create a progress bar. The class is a container for progress bars.You can try to run the following code to implement progress class in BootstrapExample Bootstrap Example 90% Complete
Read MoreC# program to get max occurred character in a String
To get the maximum occurred character in a string, loop until the length of the given string and find the occurrence.With that, set a new array to calculate −for (int i = 0; i < s.Length; i++) a[s[i]]++; }The values we used above −String s = "livelife!"; int[] a = new int[maxCHARS];Now display the character and the occurrence −for (int i = 0; i < maxCHARS; i++) if (a[i] > 1) { Console.WriteLine("Character " + (char) i); Console.WriteLine("Occurrence = " + a[i] + " times"); }Let us see the complete code ...
Read MoreReturn a C# tuple from a method
Firstly, create a tuple as shown below that calls a method.var tuple = Show();The above statement calls the following method −static Tuple Show()Under the method, return the tuple as shown below −Exampleusing System; public class Demo { public static void Main() { var tuple = Show(); Console.WriteLine(tuple.Item1); Console.WriteLine(tuple.Item2); Console.WriteLine(tuple.Item3); Console.WriteLine(tuple.Item4); Console.WriteLine(tuple.Item5); } static Tuple Show() { return Tuple.Create(3, 5, 7, 9, 11); } }Output3 5 7 9 11
Read Moreclone() method in Java
Java provides an assignment operator to copy the values but no operator to copy the object. Object class has a clone method which can be used to copy the values of an object without any side-effect. Assignment operator has a side-effect that when a reference is assigned to another reference then a new object is not created and both the reference point to the same object. This means if we change the value in one object then same will reflect in another object as well. clone() method handles this problem. See the below example.Examplepublic class Tester { public static ...
Read MoreWhat are postfix operators in C#?
The increment operator is ++ operator. If used as postfix on a variable, the value of the variable is first returned and then gets incremented by 1. It is called Postfix increment operator. In the same way, the decrement operator works but it decrements by 1.For example,a++;The following is an example showing how to work with postfix operator −Exampleusing System; class Program { static void Main() { int a, b; a = 10; Console.WriteLine(a++); b = a; Console.WriteLine(a); Console.WriteLine(b); } }Output10 11 11
Read MoreForce an element to be hidden with Bootstrap
Use the .hidden class in Bootstrap to force an element to be hiddenExample Bootstrap Example This is visible. This is hidden.
Read More