Articles on Trending Technologies

Technical articles with clear explanations and examples

What is method hiding in Java and how to use it?

Giri Raju
Giri Raju
Updated on 11-Mar-2026 2K+ Views

When super class and sub class contains same method including parameters and if they are static. The method in the super class will be hidden by the one that is in the sub class. This mechanism is known as method hiding. Example class Demo{ public static void demoMethod() { System.out.println("method of super class"); } } public class Sample extends Demo { public static void demoMethod() { System.out.println("method of sub class"); } public static void main(String args[] ) { Sample.demoMethod(); } } Output method of sub class

Read More

How to match a line not containing a word in Java Regex

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Mar-2026 541 Views

Exampleimport java.util.regex.Matcher; import java.util.regex.Pattern; public class NoRegTest {    public static void main(String[] args) {       String s="^fun";       Pattern pattern = Pattern.compile(s);       Matcher matcher = pattern.matcher("Java is fun");       if(!matcher.find()) {          System.out.println("not found");       }    } }Outputnot found

Read More

Set Column Ordering in Bootstrap

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 1K+ Views

Write the columns in an order, and show them in another one. You can easily change the order of built-in grid columns with .col-md-push-* and .col-md-pull-*modifier classes where * range from 1 to 11.Example           Bootstrap Example                                          Heading                       Before Ordering                            I am on left                                        I am on right                                                       After Ordering                            I was on left                                        I was on right                                  

Read More

How do I write variable names in Java?

Sreemaha
Sreemaha
Updated on 11-Mar-2026 4K+ Views

While choosing an identifier to declare a variable in Java you need to keep the following points in mind. The name of the variable should begin with either alphabet or, an underscore (_) or, a dollar ($) sign. The identifiers used for variables must not be keywords. No spaces or special characters are allowed in the variable names of Java. Variable names may contain 0 to 9 numbers (if not at the beginning). Variable names are case sensitive i.e. MY_NUM is different from my_num. If you use two words in a identifier then the you should follow camel case ...

Read More

Why is method overloading not possible by changing the return type of the method only in java?

mkotla
mkotla
Updated on 11-Mar-2026 3K+ Views

Overloading is the mechanism of binding the method call with the method body dynamically based on the parameters passed to the method call. If you observe the following example, it contains two methods with same name, different parameters and if you call the method by passing two integer values the first method will be executed and, if you call by passing 3 integer values then the second method will be executed.It is not possible to decide to execute which method based on the return type, therefore, overloading is not possible just by changing the return type of the method. Example ...

Read More

Runtime Polymorphism in Java

Priya Pallavi
Priya Pallavi
Updated on 11-Mar-2026 19K+ Views

Method overriding is an example of runtime polymorphism. In method overriding, a subclass overrides a method with the same signature as that of in its superclass. During compile time, the check is made on the reference type. However, in the runtime, JVM figures out the object type and would run the method that belongs to that particular object.ExampleSee the example below to understand the concept −class Animal {    public void move() {       System.out.println("Animals can move");    } } class Dog extends Animal {    public void move() {       System.out.println("Dogs can walk and run"); ...

Read More

Make an image responsive with Bootstrap

Arjun Thakur
Arjun Thakur
Updated on 11-Mar-2026 6K+ Views

To make an image responsive in Bootstrap, add a class .img-responsive to the tag. This class applies max-width: 100%; and height: auto; to the image so that it scales nicely to the parent element.The following is how you can simply make an image responsive −Example           Bootstrap Example                                    

Read More

Can we overload the main method in Java?

radhakrishna
radhakrishna
Updated on 11-Mar-2026 3K+ Views

Yes, we can overload the main method in Java, but When we execute the class JVM starts execution with public static void main(String[] args) method. Example public class Sample{ public static void main(){ System.out.println("This is the overloaded main method"); } public static void main(String args[]){ Sample obj = new Sample(); obj.main(); } } Output This is the overloaded main method

Read More

Bootstrap lead class

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 2K+ Views

The lead class in Bootstrap is used to add emphasis to a paragraph.You can try to run the following code to implement the lead class in Bootstrap −Example           Bootstrap lead class                                       Lead Example       This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is an example paragraph demonstrating the use of lead body copy.          

Read More

Bootstrap class to emphasize text

Ankith Reddy
Ankith Reddy
Updated on 11-Mar-2026 1K+ Views

HTML's default emphasis tags such as sets text at 85% the size of the parent, emphasizes a text with heavier font-weight, and emphasizes a text in italics.You can try to run the following code to an emphasis on text −Example           Bootstrap emphasis tags                                       This content is within tag       This content is within tag       This content is within tag and is rendered as italics       Left aligned text.       Center aligned text.       Right aligned text.       This content is muted       This content carries a primary class       This content carries a danger class    

Read More
Showing 30221–30230 of 61,297 articles
Advertisements