answersLogoWhite

0

📱

Java Programming

The Java programming language was released in 1995 as a core component of the Java platform of Sun Microsystems. It is a general-purpose, class-based, object-oriented language that is widely used in application software and web applications.

5,203 Questions

How do you achieve multiple inheritance?

Any class can extend one class and/or implement multiple interfaces.

For example:

public class TestClass extends SuperTestClass implements InterfaceA, InterfaceB {

// implementations of interface methods in here

}

What is an essential of Object Oriented Programming?

The 3 essential concepts of Object Oriented Programming are:

  1. Inheritance
  2. Encapsulation &
  3. Polymorphism

What is the name of java compiler?

It is simply called the Java compiler. The actual program is usually called Javac.

What is jqsiestartdetectorimpl class as an add on?

It appears to be the Java Quickstater browser plugin. As mentioned before, it shows up in a lot of hijack this entries, but not as a threat (lots of people have this as it is installed in the latest versions of java). If you are concerned, feel free to disable it or remove it. The only downside is you may have to wait an extra second or two for a web java application to start up (ex: chat rooms).

What are the codes examples for multi level inheritance?

1. Single Inheritance

A Scenario where one class is inheriting/extending the behavior of just one super class.

Ex: public class Ferrari extends Car {…}

2. Multilevel Inheritance

A Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.

Ex: public class Automobile {…}

Public class Car extends Automobile {…}

Public class Ferrari extends Car {…}

This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.

How do you define constant in java?

The null literal can be assigned to any Object reference in Java, and is usually used to indicate the absence of something. The main use of it is to indicate that a reference has yet to be instantiated. It can also be used as a return type for things like Collections to indicate that the object you're looking for doesn't exist in that particular Collection.

How do you declare an int array?

we define the array is

Array array[]={1,2,3,4,5} this is the integer Array

Array array[]={"apple","banana","carrot","mango"} this is the String Array

Differences between Java Applet and Java Beans?

Java applet is a program used to run java applications while beans is a compiler used to design java programs (IDE, GUI) :-) GilbertC

What is the difference between the constructor to and destructor?

Functions and Constructors are similar in many ways. They can have arguments, they can have any amount of code, they can access the class's variables etc. the only difference is that a method in java needs to mandatorily have a return type but a Constructor in java cannot have a return type. It always creates and returns an object of the class for which it is the constructor. You cannot return a value from a constructor explicitly and if you try to do that, the compiler will give an error. The system knows that the purpose of the constructor is to create an object of the class and it will do the same irrespective of whether you declare a return type or not.

Why java is called purely object oriented language?

Java is called a "pure" object-oriented language because it requires that all code written in it be wrapped in objects.

This differs from the more common meaning of "pure" object-oriented (everything is an object) in that Java has primitive types and primitive operations on them - int, char, double, float, long and addition, subtraction, multiplication, division. A real example of a PURE object-oriented language is Smalltalk, one of Java's predecessors.

Where can one find information on implementing a Javascript alert?

You could open a new window instead and set it to a certain size using window.open(). You would have to program a button that closes the window but that is quite easy.

You could also insert lots of new lines with '\n' in the alert text, but there's no way to change the width.

What is Pascal Java and C?

its just a different programming language, different programming languages are like real languages its just a different way of saying things however some are more complex, sophisticated, than others and some can do more than others

How much does a programming language generally cost?

Many programming languages, such as Java, are completely free to use, and being one of the major players in the programming language wars, as well as being cross-platform, in addition to being easy to learn, and in addition to it being free, many choose Java for their first language.

Another question: your question makes no sense: you cannot buy or sell programming languages.

What happens if the static modifier is removed from the signature of the main program in java?

Actually speaking nothing major happens. That method would become just another method in the class. You cannot use that as the method to begin the program execution in your class. Your class will not be a standalone java program and you cannot execute it like you did before using the public static void main() method.

How class accomplish data hiding?

Data hiding is one of the important aspects of a class. Data hiding means to hide the members of the class and providing the access to only some of them. we can make the members of the class private or public. in private,the outside world cannot access those members which been made private.and rest we can make public.only the public members are accessed by the out side world and all the private members can be accessed using only the public members.in this way a class provides security to its data members.

A final class can have instances?

Yes. You cannot inherit a final class but very well instantiate a final class

Why one public class in one source file in java?

The rules of Java state that the top-level main class needs to be declared "public." The idea behind this is probably because if it was not declared "public," then it would have to be either "private" or "protected." Since these other two types of classes can only be used by classes of the same package (or more local), and thus a non-public main class could not be called from the outside.

Give an example of an abstract data type?

some common adt's which prived useful in agreat variety of applications are container, deque ,list, map, multimap ,multiset , queue ,setstack, string, tree

"another answer"

"if we declare an integer value in c++, int x, we can say that the name attribute has value(x) and that the type attribute has value(int x=4) the value of attribute has value four.

What is the use of blue dot receptor in java ring?

  • The R/W operation in java ring is done by blue dot receptor provided by RS232 serial port adapter. DS1402D-DR8 is a 1-wire network cable designed to connect to any serial or USB 1-wire port that has up to two buttons simultaneously.
  • Information is transferred between an iButton and a PC with a momentary contact, at up to 142kbps.We just need to touch our iButton to a Blue Dot receptor or other iButton probe, which is connected to a PC.
  • The Blue Dot receptor is cabled to a 1-wire adapter that is attached to the PC's serial or parallel port.
  • Each receptor contains two Blue Dots to accommodate instances where multiple iButtons are required to complete a transaction.

How do you explain a database?

A database is a server, or storage spot were information is stored. The stored information can range from user information to settings. http://en.wikipedia.org/wiki/Database

What are the sum of the first 100 integers using the do while loop and display the result?

public class TestBB {

/**

* @param args

*/

public static void main(String[] args) {

int sum = 0;

int i = 0;

do {

sum = sum + i;

i++;

} while (i <= 100);

System.out.println("Total of 100 numbers is: " + sum);

}

}

What is wrapper class and its use?

When we need to store primitive datatypes(The data types we use in genera like:int,long,float etc)as objects, we use

wrapper classes.Means in utility classes all the utility

classes stores Objects.So when we need to store a primitive

datatype,We make an object of that primitive data and store it.

Say supposing there is a requirement to store only the

object in an array A.The Primitive types cannot be stored in

the same array as the array can accommodate only Objects

here is where Wrapper Class come into picture.ie, we create

wrapper for the primitive types.One such example is as below

Ex:int i;

Wrapper class for the primitive type(int) is created as below:

Integer i = new Integer();

That's why we use Wrapper classes in Java

What is mean by selection sort?

Selection sort works by looking for the largest value in a set and swapping it with the last value. The last value can now be ignored since it is now in place. The process repeats with the remainder of the set. After repeated passes, the remainder of the set will have only one item, the smallest value, at which point all the values will be in sorted order.

The algorithm is similar to that of bubblesort, but is generally more efficient because there can only be one swap at most for each iteration of the algorithm. With bubble sort, there may be multiple swaps per iteration. However, while the number of comparisons is the same for both algorithms, bubblesort can be optimised to minimise the number of iterations required and thus minimise the number of comparisons. Nevertheless, swapping is a more expensive operation than comparing, thus selection sort is generally faster.

Neither algorithm is suitable for sorting large sets of data.