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

What is java statement to find the maximum between two values?

You can use one of the Math.max() methods, or the ternary operator, that is, one of the following:

Math.max(a, b)

a > b ? a : b

What is the difference between nextLine and next method in scanner class java?

nextLine() reads a complete line while next() reads the next token ( a single word)

How much void point do i need for full void?

runescape question: 850 pest points, You can get these by playing pest control. You have to be a member though.

What is data type and field name?

Data Type defines the type of data that will be stored.

Example : int, byte, short etc

What is the order of initialization of data in C plus plus?

The general order of initialization is:

  1. Base class objects (if present)
  2. Member data objects
  3. Constructor function code

Difference between asp net and java?

ASP.Net and Java do not have any real comparison. Java is a computer language, where as ASP.Net is a web technology for generating web content. You could use any CLR (Common Language Runtime) targeted language to create an ASP.Net website, such as VB.Net, C#, or IronPython.

What is overloading constructor in java?

This is when you overload the constructor so that there isn't just one way you can initialize the class object

Assume you have a class called Foo and you want two different constructors


Foo(int a, int b);

Foo(float a, float b);


using a method like this can make your classes more dynamic and you don't need to to write a new class to handle different types. Sorry for the lack of Java code, i program in C++ but it you can overload functions and constructors in C++ too.

How can keyword tools be of use to students?

Keyword tools can be used by students to organize information and then select relevant sources to further identify families, core keywords and helpers. Using a keyword worksheet can help with the organization and further assist with the volume and value of the information.

How do you add import packages to a java program in netbeans?

package thisPackage;

import otherPackage.*;

class myClass {

}

Which access specifier is preferred for constant variables?

There's no such thing as a constant variable (other than as an oxymoron). A named value is either declared constant or it is declared variable, it cannot be both a constant and a variable.

You declare a constant much as you would a variable, except you use the final keyword modifier and name the constant using ALL CAPS and underscores for spaces.

final int HOURS_IN_DAY = 24;

final int DAYS_IN_WEEK;

DAYS_IN_WEEK = 7;

Note that we don't need to assign a constant value at the point of instantiation. However, once assigned we cannot then change the value. It wouldn't be a constant if we could!

The preferred access specifier depends on how useful the constant is. If only one method makes use of the constant, then it should simply be declared within that method as a local constant. If several methods of the same class make use of the constant then declare it a private member of the class. Both methods are used in the following example:

public class MyClass {

private static int HOURS_IN_DAY = 24;

public int hoursInDays (int days) {

return days * HOURS_IN_DAY;

}

public int hoursInWeeks (int weeks) {

final int DAYS_IN_WEEK = 7;

return weeks * DAYS_IN_WEEK * HOURS_IN_DAY;

}

}

Note the use of the static keyword in the constant declaration. It doesn't make sense for every object of a class to store independent copies of the same constant value, thus we must declare class constants as static members so that all objects of the class can share the same instance of the constant and thus share the same value.

If we want the constant to be accessible to our subclasses, then we can declare the constant protected. If we want to make the constant available outside of the class then we can declare it public.

Keep in mind that although constants are not variable, we should only expose what needs to be exposed outside of a class, no more and no less. A constant that provides a class implementation detail has no business being accessible outside of the class in which it is declared.

You should also be aware that the rules governing constants are different for primitive data types and objects. With primitive data types, the value is constant as one would expect. But with objects, only the reference is constant (we cannot refer to a different object) but if the referenced object allows mutations then it is not truly constant. Unfortunately, the only way to create a truly constant object from a mutable class is to subclass the mutable class and render its setters private.

Where default access database store?

the data which alerady stored in the memory of the computer and can not be change is know as default access data base store

Does the programming language JAVA has any abberivation?

No. If you need to refer to the language in fewer than four characters, you're out of luck.

Subclasses of an abstract class that do not provide an implementation of an abtract method are also abstract?

Yes. Any class that does not provide implementation to all its methods as well as its parent class methods needs to be Abstract. The Java compiler would not successfully compile a class that does not do this.

What does The server encountered an internal error that prevented it from fulfilling this request in java?

It means that, there was some problem in the Web server and it prevented it from satisfying the request it received. Usually it happens when the server crashes or when there is a database issue etc.

What is Object Oriented Programming without the principle of Polymorphism?

Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.

Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.

Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.

Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.

What is float chair?

a chair that you put in a swimming pool so you can stay cool and hold your drink.

How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.

Which language is source program written?

The Java language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities

What is an abstract class Write the syntax Declare a pure virtual function in an abstract class?

an abstract class is nothing but class which contains both abstract and concrete methods for abstract class we r nt create object

Syntax for pure abstract class is

abstract class x

{

public void abstract y();

public void abstract z();

public void abc()

{

}