calculate factorial of number
public class factorial { public static void main(String[] args) { int num = 6; …
public class factorial { public static void main(String[] args) { int num = 6; …
public class even_or_odd { public static void main(String[] args) { int num1=22; …
public class Average { public static void main(String[] args) { int mar=56; …
public class Area_of_circle { public static void main(String[] args) { int r=5; …
public class SumofAlldiviser { public static void main(String[] args) { int L=1; int R=20…
public class SumofTwonum { public static void main(String[] args) { int fnum=10; int snum…
public class SimpleAsterisk { public static void main(String[] args) { for (int i = 0; i <…
Integer class is a wrapper for int. If it is not marked final, then any other class can extend it…
Differences between Abstract class and Interface are as follows: 1. An abstract class can have im…
A final method cannot be overridden. But an interface method has to be implemented by another clas…
Yes, from Java 8 onwards, we can define static and default methods in an interface. Prior to Java …
An Interface in Java is an abstract type blueprint of a class. It contains the methods that a cla…
No. We cannot create an instance of an abstract class in Java.
No. It will be contradictory statement to mark a method abstract as well as final. An abstract me…
No. Java specification says that if there is at least one abstract method in a class, the class h…
An abstract class in Java has one or more abstract methods. An abstract method is just declared i…
Abstraction happens at class level design. It results in hiding the implementation details. Encap…
Abstraction is the process of hiding certain implementation details of an object and showing only…
In Static binding references are resolved at compile time. In Dynamic binding references are reso…
Runtime Polymorphism or Dynamic Polymorphism is the polymorphism that exists at runtime. In case …
Differences between method overloading and overriding are: 1. Method overloading is static polymo…
To override a method, you need an instance of a class. Static method is not associated with any i…
No. Java does not allow overriding a static method. If you create a static method with same name …
To override a method, we just provide a new implementation of a method with same name in subclass…
Yes, Java allows users to create many methods with same name ‘main’. But only public static void …
If we change the return type of overloaded methods then it will lead to ambiguous behavior. How w…
Method Overloading allows two methods with same name to differ in: 1. Number of parameters 2. Dat…
In Java, a class can have multiple methods with same name but different arguments. It is called M…
Often, there is a need to define a behavior for a class that is not dependent on member variables o…
As per Java specification, main method has to be marked as static. It needs only one argument tha…
No, with Java 7 onwards, you need a main() method to execute a program. In earlier versions of J…
At times, there is a class that has static member variables. These variables need some complicate…
The main method in Java is marked as static, so that JVM can call it to start the program. If mai…
Java provides the feature of static method to create behavior at the class level. The static meth…
Whenever we want to have a common property for all objects of a class, we use a class level varia…
Object.clone() method is used for creating an exact copy of the object in Java. It acts like a co…
No, Java does not allow using both super() and this() in same constructor. As per Java specificat…
‘super’ keyword is used in the methods or constructor of a child class. It refers to immediate pa…
In Java, the pointer equivalent is Object reference. When we use a . it points to object referenc…
In Java there are references instead of pointers. These references point to objects in memory. Bu…
In OOPS, Aggregation and Composition are the types of association relations. A composition is a s…
Multiple Inheritance means that a class can inherit behavior from two or more parent classes. The…
Java is an object oriented programming language. In Java, Object class is the superclass of every…
Inheritance is an important concept in Object Oriented Programming. Some objects share certain ch…
In Java, ‘this’ keyword refers to current instance of the object. It is useful for differentiatin…
If we set a method as final it means we do not want any class to override it. But the constructor…
Default constructor is the no-argument constructor that is automatically generated by Java if no …
Java is an object-oriented language, in which we create and use objects. A constructor is a piece…
All the instance variable object references in Java are null.