What is Java Programming?

Giri Raju
Updated on 30-Jul-2019 22:30:20
Java is a general-purpose high-level programming language originally developed by Sun Micro systems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.James Gosling initiated Java language project in June 1991 for use in one of his many set-top box projects. The language, initially called ‘Oak’ after an oak tree that stood outside Gosling's office, also went by the name ‘Green’ and ended up later being renamed as Java, from a list of random words.Sun released the first public implementation as Java 1.0 in 1995. It promised to ... Read More

What is the super() construct of a constructor in Java?

Sharon Christine
Updated on 30-Jul-2019 22:30:20
The super keyword is similar to this keyword. Following are the scenarios where a super keyword is used. It is used to differentiate the members of superclass from the members of the subclass if they have same names. It is used to invoke the superclass constructor from the subclass. Whenever you want to call the constructor of the superclass from a method or another constructor you can do so as: Example class Person { Person(String name) { System.out.println("Hello "+ name); } } class Student ... Read More

Can interfaces have constructors in Java?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:20
No, interfaces can’t have constructors for the following reasons − All the members of an interface are abstract, and since a constructor cannot be abstract. Still, if you try to write a constructor within an interface it will generate a compile time error. Example public interface InterfaceTest { InterfaceTest(){ } public abstract void display(); public abstract void show(); } Error C:\Sample>javac InterfaceTest.java InterfaceTest.java:2: error: expected public InterfaceTest(){ ^ 1 error

Can constructors be inherited in Java?

Monica Mona
Updated on 30-Jul-2019 22:30:20
No, constructors cannot be inherited in Java. In inheritance sub class inherits the members of a super class except constructors. In other words, constructors cannot be inherited in Java therefore, there is no need to write final before constructors. Example public interface InterfaceTest { public InterfaceTest(){ } public abstract void display(); public abstract void show(); } Still, if you try to write constructors in an interface it will generate a compile time error. Error C:\Sample>javac InterfaceTest.java InterfaceTest.java:2: error: expected InterfaceTest(){ ^ 1 error C:\Sample>

What is the difference between a String object and a StringBuffer object in java?

Rishi Raj
Updated on 30-Jul-2019 22:30:20
String class is immutable once you create an object of string you can modify its data.The StringBuffer class is immutable, once you create a StringBuffer object you can change/modify the contents of it.This class provides various methods to manipulate its data such as append(), delete(), insert() etc.

Best way to connect to SAP system from JAVA

SAP Developer
Updated on 30-Jul-2019 22:30:20
There are lots of possibilities but a lot depends upon on your exact requirement and needs.One way is that you can go ahead and use Java Connector also known as JCo. JCo is a prevalent option to do similar requirements as of yours. It has a lot of support available online as well.Also, as you said Web service is by default the web standard and can be opted too. SAP functions are readily available and can be tuned effortlessly to be available as web services.

What is the difference between super and this, keywords in Java?

Lakshmi Srinivas
Updated on 30-Jul-2019 22:30:20
The this is a keyword in Java which is used as a reference to the object of the current class. Using it you can − Differentiate the instance variables from local variables if they have same names, within a constructor or a method. Call one type of constructor (parametrized constructor or default) from other in a class. It is known as explicit constructor invocation. Example class Superclass { int age; Superclass(int age) { this.age = age; } public void ... Read More

Is there something available in Python like PHP autoloader?

Rajendra Dharmkar
Updated on 30-Jul-2019 22:30:20
No there is not. And you should not try something like that in Python. There's a good reason for autoloading in PHP which is that PHP scripts are executed from scratch every time you load some page. The opcodes may be cached and files may be already prepared, but the main point remains - importing another file actually means making sure its contents are loaded.In Python webservices, your files are not reread every time. If you import something, its imported for the lifetime of the app. Autoloaders in Python would be used only one time, not on each request.So autoloaders ... Read More

What are the differences between C++ and Java?

mkotla
Updated on 30-Jul-2019 22:30:20
Following are the major differences between C++ and Java.JavaC++Java does not support pointers, unions, operator overloading and structure.C++ supports pointers, unions, operator overloading and structure.Java supports garbage collection.C++ does not supports garbage collection.Java is platform independent.C++ is platform dependent.Java supports inheritance except for multiple inheritanceC++ supports inheritance including multiple inheritancesJava is interpreted.C++ is compiled.Java does not support destructorC++ supports destructors.

What is the difference between abstract class and a concrete class in Java?

Sai Subramanyam
Updated on 30-Jul-2019 22:30:20
Following are the notable differences between an abstract class and concrete class. Abstract class Abstract classes may or may not contain abstract methods, i.e., methods without body ( public void get(); ) But, if a class has at least one abstract method, then the class must be declared abstract. You cannot instantiate an abstract class. An abstract class may contain abstract methods. You need to inherit an abstract class to use it. If you inherit an abstract class, you have to provide implementations to all the abstract methods in it. Example public abstract class AbstractExample { ... Read More
Advertisements