Rishi Raj has Published 127 Articles

What does the method peek() do in java?

Rishi Raj

Rishi Raj

Updated on 25-Feb-2020 10:01:14

205 Views

The peek() method is used to look at the object at the top of this stack without removing it from the stack.Exampleimport java.util.*; public class StackDemo {    public static void main(String args[]) {             Stack st = new Stack();       st.push("Java");   ... Read More

How to use splash vector graphics on your Responsive Site?

Rishi Raj

Rishi Raj

Updated on 25-Feb-2020 07:27:10

147 Views

Graphics for your responsive site can make it slower, but balancing it with vector graphics can help in minimizing the bandwidth. Through this, amazing graphics work great on mobile site too. Generally, canvas and SVG is used for this purpose.Use HTML5 Scalable Vector Graphics (SVG) to create a design for ... Read More

How to create a favicon for your website?

Rishi Raj

Rishi Raj

Updated on 25-Feb-2020 06:37:29

369 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.Here, you can see the favicon, The size of a favicon is 16x16 since it also gets displayed next to the URL of your site ... Read More

Instance variables in Java

Rishi Raj

Rishi Raj

Updated on 24-Feb-2020 05:08:46

19K+ Views

Instance variables are declared in a class, but outside a method, constructor or any block.When space is allocated for an object in the heap, a slot for each instance variable value is created.Instance variables are created when an object is created with the use of the keyword 'new' and destroyed ... Read More

How to search for a pattern in a Java string?

Rishi Raj

Rishi Raj

Updated on 20-Feb-2020 05:16:07

2K+ Views

Java provides the java.util.regex package for pattern matching with regular expressions. You can then search for a pattern in a Java string using classes and methods of this packages.Exampleimport java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexMatches {    public static void main( String args[] ) {       String line ... Read More

How to extract the first n characters from a string using Java?

Rishi Raj

Rishi Raj

Updated on 20-Feb-2020 04:46:52

620 Views

To find the consonants in the given String compare every character in it using the charAt() method with the vowel letters and remaining are consonants.ExampleLive Demopublic class FindingConsonants {    public static void main(String args[]) {       String str = new String("Hi Welcome to Tutorialspoint");       for(int i=0; i

What is the difference between String s1 = "Hello" and String s1= new String("Hello") in java?

Rishi Raj

Rishi Raj

Updated on 19-Feb-2020 12:48:04

3K+ Views

When you store a String asString str1 = "Hello";directly, then JVM creates a String object with the given value in a separate block of memory known as String constant pool.And whenever we try to create another String asString str2 = "Hello";JVM verifies whether any String object with the same value ... Read More

What are Enumerated Constants in C++?

Rishi Raj

Rishi Raj

Updated on 11-Feb-2020 08:25:36

1K+ Views

An enumerated type declares an optional type name and a set of zero or more identifiers that can be used as values of the type. Each enumerator is a constant whose type is the enumeration. These are also called as enumerated constants.For example, if you are creating an application that ... Read More

What is C++ Standard Output Stream (cout)?

Rishi Raj

Rishi Raj

Updated on 10-Feb-2020 13:34:36

6K+ Views

std::cout is an object of class ostream that represents the standard output stream oriented to narrow characters (of type char). It corresponds to the C stream stdout. The standard output stream is the default destination of characters determined by the environment. This destination may be shared with more standard objects ... Read More

How to Install C++ Compiler on Linux?

Rishi Raj

Rishi Raj

Updated on 10-Feb-2020 12:20:50

3K+ Views

There are several alternatives for compiling C++ on Linux. Let's look at 2 of them −GCCAlmost all Linux distros come with GCC installed. Check whether GCC is installed on your system by entering the following command from the command line −$ g++ -vIf you have installed GCC, then it should ... Read More

Previous 1 ... 3 4 5 6 7 ... 13 Next
Advertisements