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

Can someone be hacking your system with Java?

Java is a programming language, you can use ANY programming language to make exploits to ... exploit one's system.

As of today, I have seen numerous amounts of ways to be infected by Java.

For example, the java drive by. If you click run, it will start loading a virus onto your computer.

Write a cobol pgm to find the Fibonacci series?

Identification division. Program-id. Fibonacci. Environment division. Data division. Working-storage section. 77 n pic 9(18). 77 n1 pic z(18). 77 m pic 9(18) value 1. 77 o pic 9(18). 77 i pic 9(4) value 1. 77 q pic x. Procedure division. Para-a. Display ( 1 , 1 ) erase. Display ( 2 , 1 ) "fibonacci numbers from 1 to 100 are:". Move 0 to n. Display " ". Display 0. Display 1. Move 0 to o. Para-b. Compute n = o + m. Move n to n1. Move m to o. Move n to m. Display n1. Add 1 to i. If i = 21 display "press tab key to view next page." accept q. If i = 41 display "press tab key to view next page." accept q. If i = 61 display "press tab key to view next page." accept q. If i = 81 display "press tab key to view next page." accept q if i = 99 go to stop-para else go to para-b. Stop-para. Display " ". Stop run.

Modify the program in Java to produce the following form of Floyd's triangle 1 01 101 0101 10101?

import java.io.*;

class floyd

{

public static void main(String args[])

{

int i,j,k=0,l,n;

system.out.println("enter the no of iteration is"+n);

for(i=1;i<=n;i++)

{

for(j=1;j<=i;j++)

{

k++;

a=k%2;

system.out.println(""+a);

}

for(l=i;l<=n;l++)

{

k++;

}

system.out.println("\n")

}

}

What language can replace Java for Android?

Programming is usually done in Java, but you can use lots of different development tools, for example Delphi, Lazarus, etc. The Wikipedia article "Android software development" provides more details.

How do you program a microchip in java?

Every microchip has it's own set of low level instructions, so it's not possible to give a single answer that would give programming instructions for ALL microchips.

The easiest way to program a microchip would be to purchase a developers kit. The developers kit typically has:

  • Some kind of programming environment, if you want Java, just find a developers kit that uses Java.
  • Some kind of emulation software. It lets you try the program to see if it does what you want without burning a microchip.
  • It will also include "burning" hardware, that allows the programmer to load the program into the microchip.

Developers kits vary in price and complexity, as do the microchips. Some microchips are very simple, with a limited instruction set, small program space and a simple I/O. Other microchips include UART's, built in timers, and just about anything you can imagine.

How do you print non-prime numbers in java?

Loop through some numbers - for example, 2 through 100 - and check each one whether it is a prime number (write a second loop to test whether it is divisible by any number between 2 and the number minus 1). If, in this second loop, you find a factor that is greater than 1 and less than the number, it is not a prime, and you can print it out.

What are the naming conventions for accessor methods and mutator methods?

Accessors: getValue

Mutators: setValue

Example:

class MyClass {

int num;

int getNum() {

return num;

}

void setNum(int num) {

this.num = num;

}

}

Do a java program to scan a number n and then output the sum of the powers from 1 to n thus if the input is 4 the output should be 288 because?

#include <stdio.h>

int main() {

int n;

long s = 0;

scanf("%d", &n);

for (int i=1; i<=n; i++) {

int k = 1;

for (int j=1; j<=n; j++) k=k*i;

s = s + k;

}

printf("%d\n", s);

return 0;

}

What are legal lines of Java code?

Don't type "the following" if you don't provide a list. It doesn't make any sense, and just wastes everybody's time.

What type of data does RAM hold?

In the broadest terms, it holds both instructions (computer programs) and user data. Programs might include the operating system, games, an antivirus and a firewall program, office programs, etc.; data might include a document you are working on, images, music, etc. In all cases, long-term storage is on a hard disk or similar device - hard disks are common in the case of personal computers. The RAM temporarily holds information that has been "loaded" or "opened".

What is hibermate in computer programming?

You probably mean "hybernate"; that refers to a computer saving all contents of its memory (RAM) to hard disk, so that it can be turned off, kept off indefinitely without using power, then turned on again (and memory reloaded from the hard disk), to let the user continue right where he was. For instance, any documents that were open when the computer was hibernated will be immediately available after resuming.

What are the purpose of a method parameter?

Method Parameters or Arguments are values that are passed to methods to aid the method in carrying out its intended functionality.

Ex:

public int add() {}

The above method is named "add" because it is supposed to add a few numeric values. But what will this method add? It needs input values that need to be added. Look at the below declaration

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

This looks better because now we know that, this method is supposed to add the two numbers that are passed to it.

Here "a" and "b" are the parameters to the method

What is java console?

The Java console is a display of output sent by a Java program. This is similar to the MS DOS operating system.

To print to the console, a programmer will type "println(text);" or "print(text);" depending is the programmer wants to make a new line after the text(println) or not(print).

How do you expertise in java?

It depends on your definition of "expertise", but I think that it means that you are the holder of multiple Java certifications, such as the Microsoft CME and the Sun SCJP.

Are loop colostomies permanent?

A loop colostomy is most often performed for creation of a temporary stoma to divert stool away from an area of intestine that has been blocked or ruptured.

How can you display photos and images in Java Swings?

Java Swings has a lot of nice features and one of them is the ability to display images on its components. You can select any image that is available in the local system or somewhere on the internet and display it on Graphics objects. As of Java SE 1.4, reading an image is very simple.

If the image is stored in a local file:

String filename = "...";

Image image = ImageIO.read(new File(filename));

Otherwise, you can supply a URL:

String urlname = "...";

Image image = ImageIO.read(new URL(urlname));

The read method throws an IOException if the image is not available.

Now the variable image contains a reference to an object that encapsulates the image data. You can display the image with the drawImage method of the Graphics class.

public void paintComponent(Graphics g)

{

. . .

g.drawImage(image, x, y, null);

}

Sometimes, you may want to tile an image across a components canvas if it is much smaller than the component size. We can do the tiling in the paintComponent method. We first draw one copy of the image in the top-left corner and then use the copyArea call to copy it into the entire window using the code below:

for (int i = 0; i * imageWidth <= getWidth(); i++) for (int j = 0; j * imageHeight <= getHeight(); j++) if (i + j > 0)

g.copyArea(0, 0, imageWidth, imageHeight, i * imageWidth, j * imageHeight);

What would the valid subscript values be in a four element array of doubles?

since the array is four elements and array subscripts start at zero, the valid ones would be 0, 1, 2, 3

What does Error converting data type to numeric means?

You must have declared a method which tries to convert a variable/field value into a numeric value but that is not possible. Refer to the line on which the error is found and remove the method which tries to convert the variable/field.

Note: Java allows type casting so a string cannot be converted into integer even if a method tries to change the value