Syed Javed has Published 46 Answers

This keyword in Java

Syed Javed

Syed Javed

Updated on 05-Mar-2020 12:19:55

Following are the usage of this keyword. this can be used to get the current object.this can be used to invoke current object's method.this() can be used to invoke current class constructorthis can be passed as a parameter to a method call.this can be passed as a parameter to a constructor.this ... Read More

Factorial program in Java using recursion.

Syed Javed

Syed Javed

Updated on 05-Mar-2020 12:17:30

Following is the required program.ExampleLive Demopublic class Tester {    public static void main(String args[]) {       int i, fact = 1;       int number = 5;       for (i = 1; i

Infinite while loop in Java

Syed Javed

Syed Javed

Updated on 27-Feb-2020 05:25:01

Yes. Following while loop is a valid statement and causes an infinite loop.while(true);

Print Hello World without semicolon in C++

Syed Javed

Syed Javed

Updated on 11-Feb-2020 06:57:23

There are multiple ways to write a C++ program without semicolons. Note that doing this is very bad practice and should never be used in real code. This is presented just as informational content. The easiest way to write a C++ Program without Semicolons is using if statements. Almost all ... Read More

What are the good resources to Learn C++?

Syed Javed

Syed Javed

Updated on 10-Feb-2020 11:18:33

There are many resources on the web that can help you learn C++. I've tried to give you a compiled list of some of the best resources out there to learn C++ −C++ − This is a great place to learn C++ as it covers almost all basic and intermediate ... Read More

How to change font size in HTML?

Syed Javed

Syed Javed

Updated on 09-Jan-2020 06:49:44

To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element.  The attribute is used with the HTML tag, with the CSS property font-size. HTML5 do not support the tag, so the CSS style is used to add ... Read More

What is an array in Java?

Syed Javed

Syed Javed

Updated on 30-Jul-2019 22:30:22

An array is a data structure/container/object that stores a fixed-size sequential collection of elements of the same type. The size/length of the array is determined at the time of creation. The position of the elements in the array is called as index or subscript. The first element of the array ... Read More

Can a method have the same name as the class?

Syed Javed

Syed Javed

Updated on 30-Jul-2019 22:30:22

Yes, you can write a method in Java with method name same as class name. But it is not suggestable because of the following reasons − Using upper case letter at the starting of the name of the method violates the coding conventions of Java for writing a methods ... Read More

What is the character wrapper class and its methods in Java?

Syed Javed

Syed Javed

Updated on 30-Jul-2019 22:30:22

The Character class of the java.lang package wraps a value of the primitive datatype char. It offers a number of useful class (i.e., static) methods for manipulating characters. You can create a Character object with the Character constructor. Character ch = new Character('a'); Following are the notable methods ... Read More

What is the object class in Java?

Syed Javed

Syed Javed

Updated on 30-Jul-2019 22:30:22

The java.lang.Object class is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class. Example Following example demonstrates the usage of the Object class. Here we are getting the name of the current class using the getClass() ... Read More

Advertisements