Arushi has Published 157 Articles

Why do we use the novalidate attribute in HTML?

Arushi

Arushi

Updated on 14-May-2020 09:12:47

5K+ Views

The novalidate attribute in HTML is used to signify that the form won’t get validated on submit. It is a Boolean attribute and useful if you want the user to save the progress of form filing. If the form validation is disabled, the user can easily save the form and ... Read More

How do I set up C/C++ on Eclipse in Windows?

Arushi

Arushi

Updated on 26-Feb-2020 11:21:22

8K+ Views

Step 1 − Install MinGW GCC or Cygwin GCCTo use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but has fewer features.MinGW GCCTo ... Read More

How to check if String is empty in Java?

Arushi

Arushi

Updated on 26-Feb-2020 08:24:12

206 Views

The isEmpty() method of the String class returns true if the length of the current string is 0.ExampleLive Demoimport java.lang.*; public class StringDemo {    public static void main(String[] args) {       String str = "tutorialspoint";       //prints length of string       System.out.println("length ... Read More

String Handling in Java

Arushi

Arushi

Updated on 26-Feb-2020 05:46:34

15K+ Views

Strings, which are widely used in Java programming, are a sequence of characters. In Java programming language, strings are treated as objects.The Java platform provides the String class to create and manipulate strings.The most direct way to create a string is to write −String greeting = "Hello world!";Whenever it encounters ... Read More

What does the method lastElement() do in java?

Arushi

Arushi

Updated on 25-Feb-2020 10:08:06

91 Views

The lastElement() method is used to return the last component of the vector.Exampleimport java.util.Vector; public class VectorDemo {    public static void main(String[] args) {       Vector vec = new Vector(4);       vec.add(4);       vec.add(3);       vec.add(2);       vec.add(1);       System.out.println("Last element: "+vec.lastElement());    } }OutputLast element: 1

What does the method push(Object item) do in java?

Arushi

Arushi

Updated on 25-Feb-2020 10:04:00

383 Views

The push(Object item) method is used to Pushes an item onto the top of this stack.Exampleimport java.util.*; public class StackDemo {    public static void main(String args[]) {       Stack st = new Stack();       st.push("Java");       st.push("Source");       st.push("code");     ... Read More

What are free Online Favicon Generators?

Arushi

Arushi

Updated on 25-Feb-2020 06:34:55

203 Views

A favicon is a little icon visible on the web browser tab, just before the page title. It is generally a logo with the smaller size. Creating it is not something to worry about. Online Favicon Generators easily gives options to create a Favicon for free on button click.Let us ... Read More

Initialization, declaration and assignment terms in Java

Arushi

Arushi

Updated on 25-Feb-2020 06:15:44

1K+ Views

A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied ... Read More

How do you find the sum of all the numbers in a java array

Arushi

Arushi

Updated on 24-Feb-2020 10:38:11

118 Views

Following program print the sum of the all the numbers in an array.Examplepublic class Tester {    public static void main(String[] args) {       int[] dataArray = {1, 2, 3, 4};       int sum = 0;       for(int i: dataArray) {          sum += i;       }       System.out.println(sum);    } }Output10

How to count the number of lines in a text file using Java?

Arushi

Arushi

Updated on 20-Feb-2020 05:15:24

1K+ Views

To count the number of lines in a fileInstantiate the FileInputStream class by passing an object of the required file as parameter to its constructor.Read the contents of the file to a bytearray using the read() method of FileInputStream class.Instantiate a String class by passing the byte array obtained, as a parameter its ... Read More

Previous 1 ... 4 5 6 7 8 ... 16 Next
Advertisements