The static methods belong to the class and they will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference).Examplepublic class Sample{ static int num = 50; public static void demo(){ System.out.println("Contents of the static method"); } public static void main(String args[]){ Sample.demo(); } }OutputContents of the static methodThe "this" keyword is used as a reference to an instance. Since the static methods doesn’t have (belong to) any instance you cannot use the "this" reference within ... Read More
The static methods belong to the class and they will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference).Examplepublic class Sample{ static int num = 50; public static void demo(){ System.out.println("Contents of the static method"); } public static void main(String args[]){ Sample.demo(); } }OutputContents of the static methodThe "this" keyword is used as a reference to an instance. Since the static methods doesn’t have (belong to) any instance you cannot use the "this" reference within ... Read More
setInterval()This is one of the many timing events. The window object allows code to execute at every certain interval of time. This object has provided SetInterval() to repeat a function for every certain amount of time. It takes two parameters as arguments. One is the function and the other is the time that specifies the interval after which the function should be repeated.syntaxwindow.setInterval(function, milliseconds, param1, param2, ...));This method can also take other parameters and can add it to the function.Example-1In the following example, setInterval() method is defined and a time interval of 3000 millisecs or 3 seconds is declared. Therefore the function provided ... Read More
When you compile a program if you see this error it indicates that either you have not installed Java in your system properly or, you haven’t set the Path variable.The Path variable − The path environment variable is used to specify the set of directories which contains executional programs.When you try to execute a program from command line, the operating system searches for the specified program in the current directly, if available, executes it.In case the programs are not available in the current directory, operating system verifies in the set of directories specified in the ‘PATH’ environment variable.Setting Up the ... Read More
100BASE-TX is the technical name of Fast Ethernet over twisted pair cables. It is a predominant form of Fast Ethernet carrying data traffic at 100 Mbps (Mega bits per second) in local area networks (LAN). It was launched as the IEEE 802.3u standard in 1995. Here, 100 is the maximum throughput, i.e. 100 Mbps, BASE denoted use of baseband transmission, and TX denotes use of twisted pair cables in Fast Ethernet.PropertiesThis has either two pairs of unshielded twisted pairs (UTP) category 5 wires or two shielded twisted pairs (STP) type 1 wires.One of these pairs transmits frames from hub to ... Read More
Selenium started originally as an internal tool at Thought Works in Chicago which was being developed by Jason Huggins in 2004. He was helped by Paul Gross and Jie Tina Wang and they built a Core mode as "JavaScriptTestRunner" for the testing of an internal Time and Expenses application (Python, Plone).They then thought of open-sourcing the test tool. ThoughtWorkers in various offices around the world picked up Selenium for commercial projects.Selenium RC was the first version of Selenium. In 2007, Huggins joined Google. Together with others like Jennifer Bevan, he continued with the development and stabilization of Selenium RC.In 2008, ... Read More
setTimeout()This is one of the many timing events. The window object allows the execution of code at specified time intervals. This object has provided SetTimeout() to execute a function after a certain amount of time. It takes two parameters as arguments. One is the function and the other is the time that specifies the interval after which the function should be executed.syntaxwindow.setTimeout(function, milliseconds);Example-1In the following example, the time passed to the setTimeout() function is 2 seconds. Therefore the function will be executed after two secs and display the output as shown.Live Demo wait 2 seconds. setTimeout(function(){ ... Read More
This example demonstrates how do I use Radio button 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. Step 3 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; public class MainActivity extends AppCompatActivity { RadioGroup radioGroup; RadioButton radioButton; Button button; @Override protected void onCreate(Bundle savedInstanceState) { ... Read More
This example demonstrates how do I can I set a border for an ImageView 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 projectStep 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }Step 4 − Create a layout from in res/layout and add the ... Read More
This example demonstrates how do I create a listView with rounded corners 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. Step 3 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListView listView = findViewById(R.id.listView); ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP