Explain with example to describe when to use abstract class and interface? Consider a scenario where all Cars will have 4 tyres and other features can be different. In this case any subclass of Car has to have 4 tyres. This is a case where abstract class will be used and a default implementation for […]
Tag: Java Basics
How can we call the garbage collector?
How can we call the garbage collector? Garbage collector is automatically invoked when the program is being run. It can be also called by calling gc() method of Runtime class or System class in Java NarayanaswamyHello! I am Narayanaswamy founder and admin of narayanatutorial.com. I have been working in the IT industry for more […]
Which algorithm is used by garbage collector?
Which algorithm is used by garbage collector Garbage collector uses many algorithms but the most commonly used algorithm is mark and sweep. NarayanaswamyHello! I am Narayanaswamy founder and admin of narayanatutorial.com. I have been working in the IT industry for more than 12 years. NarayanaTutorial is my web technologies blog. My specialties are […]
Which part of JVM will allocate the memory for a java program?
Which part of JVM will allocate the memory for a java program? Class loader sub sytem of JVM will allocate the necessary memory needed by the Java program. NarayanaswamyHello! I am Narayanaswamy founder and admin of narayanatutorial.com. I have been working in the IT industry for more than 12 years. NarayanaTutorial is my […]
Why java is suitable for internet?
Why java is suitable for internet? Java is suitable for internet because of two main reasons. It is system independent and hence its programs can run on any type of computer system on internet. It eliminates a lot of security problems for data on internet. NarayanaswamyHello! I am Narayanaswamy founder and admin of […]
What is difference between abstract class and interface?
What is difference between abstract class and interface? Abstract class may or may not be contain abstract methods but a class should be called as abstract when it contains at least one abstract method. It can also contain n numbers of concrete method. Interface can contain only abstract ( non implemented) methods. The abstract […]
What is the difference between static and instance methods?
What is the difference between static and instance methods? Instance method belongs to the instance of a class therefore it requires an instance before it can be invoked, whereas static method belongs to the class itself and not to any class instance so it doesn’t need an instance to be invoked. Instance methods use dynamic […]
What is difference between function and method?
Why should I choose Java software development?
Why should I choose Java software development? What are the Pros and Cons? Java Pros It’s free cost, download it and start creating application. Open source with quite large community base. Lots of available third party libraries, frameworks & IDE for fast development cycles(Spring, Hibernate, Struts, Eclipse, IntelliJ). Platform independent, write once run on most […]
Java Setup Hello World Example
In this post, I am explaining the Java Setup to run a Hello World Example for beginners. Java Setup Hello World Example First of all we need to download open source java software from official oracle site. Download You can download java software according your system configuration i.e. 1. Operating system (Linux, Mac OS, Windows, Solaris […]