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 high school did Patrick dempsey graduate from?

he didn't graduate. he dropped out of st. Dominic regional high school

Difference in using a method that return value and method that does not return value in object orinted programming?

A method that return a value should have a return statement. The method signature should indicate the type of return value.

While in the case of a method that does not return a value should not have a return statement and in the signature, the return type is void.

When using a method that doesn't return a value, a programmer can not get a value from that function, but instead, it can only change variable values and run other methods.

What are the object oriented themes?

OO Technology is full of several themes. These themes are Abstraction, Encapsulation, Polymorphism, Inheritance etc.,

Can Java class files run on UNIX system?

Show activity on this post.

  1. Go to the path where you saved the java file you want to compile.

  2. Replace path by typing cmd and press enter.

  3. Command Prompt Directory will pop up containing the path file like C:/blah/blah/foldercontainJava.

  4. Enter javac javafile.java.

  5. Press Enter. It will automatically generate java class file.

To learn more about data science please visit- Learnbay.co

1 Explain the concepts of constructor and destructor Do you have to declare a constructor every time you create a class?

You only need a constructor if the default constructor will not suffice. Often times, it is useful to have a constructor that takes common parameters so that you do not have to write additional code. For example, a Point class might have a constructor for Point(int x, int y), which would be a shortcut for assigning x and y independently. Other classes may not need any default values assigned, and for this, it is acceptable to just use the default constructor. Finally, some classes are virtual, static, or abstract, and so may not need a constructor because the constructor is unnecessary (static), or may be defined elsewhere (virtual, abstract).

WAP in java to search for a given number using linear search?

// This method will search through nums for target.

// It will return the index of target in nums, or -1 if target is not in nums.

public static int search(final int target, final int[] nums) {

// Linear search means start at one end and search element-by-element

for(int i = 0; i < nums.length; ++i) {

if(nums[i] == target) {

return i;

}

}

return -1;

}

Define an expression that evaluates to true when i equals j?

In Java, or C, the expression is simply:

i == j

If the two are equal, this expression will evaluate to true; if not, it will evaluate to false.

In Java, or C, the expression is simply:

i == j

If the two are equal, this expression will evaluate to true; if not, it will evaluate to false.

In Java, or C, the expression is simply:

i == j

If the two are equal, this expression will evaluate to true; if not, it will evaluate to false.

In Java, or C, the expression is simply:

i == j

If the two are equal, this expression will evaluate to true; if not, it will evaluate to false.

Is indentation is different from comment in programming?

Both are (usually) ignored by the compiler. For the programmer, indentation and comments serve quite different purposes. Indentation shows clearly what is the scope of a FOR, IF, etc. Comments give additional explanation about some part of the code that might otherwise be confusing. For instance, they may explain the purpose of a method or class in more detail.

Both are (usually) ignored by the compiler. For the programmer, indentation and comments serve quite different purposes. Indentation shows clearly what is the scope of a FOR, IF, etc. Comments give additional explanation about some part of the code that might otherwise be confusing. For instance, they may explain the purpose of a method or class in more detail.

Both are (usually) ignored by the compiler. For the programmer, indentation and comments serve quite different purposes. Indentation shows clearly what is the scope of a FOR, IF, etc. Comments give additional explanation about some part of the code that might otherwise be confusing. For instance, they may explain the purpose of a method or class in more detail.

Both are (usually) ignored by the compiler. For the programmer, indentation and comments serve quite different purposes. Indentation shows clearly what is the scope of a FOR, IF, etc. Comments give additional explanation about some part of the code that might otherwise be confusing. For instance, they may explain the purpose of a method or class in more detail.

Source code of text editor with compiler?

Check out open source sites, such as FreshMeat or SourceForge, or the GNU project.

What are Emerson class numbers?

Soil dispersion potential is the likelihood that soils will release a cloud of fine clay particles when brought into contact with water. These clay particles may remain suspended for an indefinite period of time, resulting in turbid, 'dirty' water, which can impact on plant and animal life in and around our waterways and in Moreton Bay. Scientific studies focussing upon the health of the Brisbane River and Moreton Bay have demonstrated that sedimentation of these particles is threatening seagrass meadows in the Bay, with corresponding impacts on Bay ecology and specific species such as dugong, green sea turtles and fisheries. Note that soil dispersion can occur without the influence of slope, mechanical action or run-off velocity, ie. in 'still water', so it is imperative that run-off from dispersive soils is retained and treated on-site wherever practicable (even on smaller sites), before release into the natural or constructed stormwater system. Soil dispersion potential is measured as the Emerson Class number (a simple semi-quantitative dispersion test), which considers soil consistency, depth, and in some cases established soil electro-chemical data. Note that weathered parent rock substrates can show dispersive tendencies also. Dispersive soils usually contain significant amounts of clay, with at least moderate levels of chemically exchangeable Sodium, if they are not buffered by salinity.

Write a program to generate a random sequence of capital letters that does not include vowels in java?

public class Capitals {

public static void main(String args[]) {

int counter = 0; // Counter for number of capitals generated.

int numberToGenerate = 20; // Number of capitals to generate.

char symbol = 0; // Variable to store a random character.

// While there are still letters to generate:

while( counter < numberToGenerate ) {

// Generate a random symbol between A and Z:

// This relies on the fact that the codes for the letters are in a

// contiguous sequence from 'A' to 'Z'. If we add 1 to 'A' we get the

// code for 'B', if we add 2 we get 'C', and so on. Thus to create a

// random capital letter from 'A' to 'Z' we can add a random integer

// between 0 and 25 to 'A'.

symbol = (char)(26*Math.random() + 'A');

switch(symbol) {

//Vowels ignored:

case 'A':

case 'E':

case 'I':

case 'O':

case 'U':

break;

default:

//Consonant displayed:

System.out.print(symbol + " ");

counter++;

break;

}

}

}

}

by:- Munawar Ali bhurgri from Badin

0300-2490262

Difference between getmessage and getlocalizedmessage in exceptions Java?

Java Exceptions inherit their getMessage and getLocalizedMessage methods from Throwable (see the related link). The difference is that subclasses should override getLocalizedMessage to provide a locale-specific message.

For example, imaging that you're adapting code from an American-English speaking company/group to a British-English group. You may want to create custom Exception classes which override the getLocalizedMessage to correct spelling and grammer to what the users and developers who will be using your code might expect. This can also be used for actual translations of Exception messages.

Two methods cannot have the same name in Java A True B False?

Multiple methods with the same name is called method overloading. The way to do this is to have the different methods accept different parameters.

Examples: Adding two values and returning the result. Let's use different methods for adding various numeric primitives.

public static int add(int a, int b) {

return a + b;

}

public static short add(short a, short b) {

return a + b;

}

public static long add(long a, long b) {

return a + b;

}

public static float add(float a, float b) {

return a + b;

}

public static double add(double a, double b) {

return a + b;

}

What is upper and lower case numbers and letters?

There are no upper or lowercase numbers, but uppercase letters are like this: ABCDEFGHIJKLMNOPQRSTUVWXYZ and lowercase are like this: abcdefghijklmnopqrstuvwxyz.

----

Contrary to what the above answerer has said, there actually are upper and lowercase numbers, which are used specifically when designing using typography.

An Uppercase Number, 1 = One < Uppercase

What are persuasive arguments to use against your parents when asking for a nostril piercing?

1) have a licensed person to do it, so its safe... 2)they did far worse things as a teenager 3)better than a tattoo 4) without their permision, youll try and do it yourself, and probably get infected. 5) they arent paying for it. 6) you can take it out for job interviews good luck

Write a function that reads an integer and determines and prints how many digits in the integer are 7s?

== ==

// Returns number of 7s in num.

int numSevens(int num) {

int _num = num;

int numSevens = 0;

while( _num > 0 ) {

if( (_num % 10) == 7 ) {

++numSevens;

}

_num /= 10;

}

return numSevens;

}

What do array elements all have in common?

They are all of the same type and they all have an index position that signifies their location in the array

What are the advantages of java swing over java applet?

I think you may have your terminology off a bit.

javax.swing is a Java package of graphical user interface (GUI) classes.
An Applet is a class designed to be embedded in a web browser.

Among the classes in the Swing package is JApplet, which is an Applet extended to work with Swing components.

There really is no "advantage" of one thing over the other. They are just different, if related, parts of Java.