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 whitespace in java program?

Any spaces, tabs, or blank lines, that don't contain actual commands. Whitespace is used to separate keywords, variables, etc. Whether you put a single space, several spaces, an ENTER, or some other combination is irrelevant for the compiler, but it is still extremely important to use proper indentation, because otherwise, the program will be very confusing for a human to read.

Which os is build in Java compiler?

Java compiler available on multiple platforms, the class files it generates are platform-independent.

Write 8085 program on bubble sort algorithm?

The basic algorithm for a bubble sort requires a boolean indicator. As the program cycles through the array to be sorted, it steps by one and compares n and n+1. If n+1 is greater than n, then they are swapped, the boolean indicator is set to false and the comparator increments by one. Once the comparator makes a complete cycle through without the indicator flagging to false, the array is sorted.

What did you learn anything useful from high school computer class about java programming?

Java programming is very important because it can help you make web applications. Thanks for one reason but I need more reasons for my opinion piece!

When was Conversations with Inanimate Objects created?

Conversations with Inanimate Objects was created in 2005.

Is it safe to download Java software?

Anytime you download software the will be executed on your computer, you face risks. Make sure you know the source of the software. Then you can judge whether or not the level of risk is acceptable vs. the potential benefits of the software.

Is interface class a valid term?

Yes. An interface in essence is a java class and so you can use the term interface class. But, using the term class along with the term interface can cause ambiguity or misunderstandings among novice java developers. So, using the term "Interface" along would suffice to refer to a type of class which is the "Interface"

What is JDBC package in java?

JDBC stands for Java Data Base Connectivity. As the name suggests the package is reposnisble for database connectivity. It is a standard API defined for database access.

What is low-level symbolic programming language?

In contrast to a high-level language, which formats itself more to allow the programmer to understand his/her work and program flow, a low-level language formats itself in terms of a computer's or circuit's own internal structure. Rather than you saying what you want to do and letting the compiler figure out how to tell the machine what to do, you're basically telling the machine directly what to do: in its own "words," so to speak.

Assembler languages are perhaps the best-known low-level languages.

What is Function oriented design?

Function oriented design breaks a system down into one or more named functions which transform their inputs to produce an output, such that the output of one function may be used as input to another function. In addition, the system also typically provides a global state which any function may operate upon.

In order for the "system of functions" to operate there has to be single point of entry which is typically provided by the system's global main function. The inputs for this particular function are derived from the command line used to invoke the system while the output is an integer typically used to indicate a system-defined error (with the value 0 usually indicating no error). Typically, the global main function decodes the command line parameters to determine what work is to be performed (if any) and to delegate that work to an appropriate function.

Although a single function can perform a significant amount of work, complex systems are much easier to understand when the work is divided amongst many smaller, simpler functions. When the functions are appropriately named, code becomes largely self-documenting, with the low-level implementation details largely hidden from the user.

How do you choose the version of Java to use with your browser when you have more than one version of Java installed?

Its good practice to always use the most recent version of the respective software system you are trying to run. In the case of Java that means you want to run Java JRE 1.6 for pretty much everything. You also may want to consider removing the older versions of Java as they may conflict with the newer version.

How do you code a program to find kaprekar number?

import java.io.*;

class kaprekar

{

public static void main(String args[])throws IOException

{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter any number");

int n=Integer.parseInt(br.readLine());

int t=n,count=0;

while(n!=0)

{

n=n/10;

count++;

}

int s=t*t;

int p=(int)Math.pow(10,count);

int ld=s%p;

int minus=s-ld;

int fd=minus/p;

int sum=fd+ld;

if(sum==t)

{

System.out.println("Kaprekar Number");

}

else

{

System.out.println("Not a Kaprekar number");

}

}

}

Which awt component can hold a menu in advanced java?

There are classes in java.awt Menu and MenuItem which are used for the creation of menus and they can be put inside Frame.

Fetching data from excel sheet from Java?

The Apache POI project is a Java API to read and write Microsoft Documents.


The API allows you can read and write MS Excel files using Java.

Explain with an example the if-else-if construct in java language?

The If else if construct is usually used when a series of conditions need to be validated or checked one by one.

Say for example you are writing a program to decide on projected weight of a person then you may need to have an if - else if block.

If height > 4 feet then

weight should be atleast 40 kgs

else if height > 5 feet then

weight should be atleast 50 kgs

else if height > 6 feet then

weight should be atleast 60 kgs

and so on...

Example code.

This method takes the height in inches as input and returns weight in kilograms as output.

public int getMinWeight(int height){

if(height > 4) {

return 40;

} else if(height > 5){

return 50;

} else if (height > 6){

return 60;

} else {

return 70;

}

}

Can you have two mains in java?

Yes...

We can have more than one main in JAVA...

Just make the only one main method as public and other as default access specifier....

public class Test

{

public static void main(String args[])

{

}

}

class Test1

{

public static void main(String args[])

{

}

}

class Test2

{

public static void main(String args[])

{

}

}

Just copy the above code and try....

Have fun in learning... :-) :) :-)

Write a C program to implement relocatable loader?

#include<stdio.h>

#include<conio.h>

#include<string.h>

#include<stdlib.h>

struct object_code

{

int locctr;

char add[10];

}obcode[300];

void main()

{

char input[100][16],output[100][16],binary[20],address[20],stloc[10];

int len,bitmask,loc,tlen=0,tloc,textloc,i=0,location,j,k,count=0,start,n,num=0,inc=0;

FILE *fp1,*fp2;

clrscr();

fp1=fopen("linput.dat","r");

fp2=fopen("reloadout.dat","w");

printf("Enter the location where the program has to be loaded:");

scanf("%s",stloc);

start=atoi(stloc);

location=start;

tloc=start;

fscanf(fp1,"%s",input[i]);

while(strcmp(input[i],"T")!=0)

{

strcpy(output[i],input[i]);

i++;

fscanf(fp1,"%s",input[i]);

strcpy(output[i],input[i]);

}

itoa(start,output[2],10);

while(strcmp(input[i],"E")!=0)

{

strcpy(output[i],input[i]);

if(strcmp(input[i],"T")==0)

{

for(j=0;j<3;j++)

{

i++;

fscanf(fp1,"%s",input[i]);

strcpy(output[i],input[i]);

}

bitmask=atoi(output[i]);

itoa(bitmask,binary,2);

strcpy(output[i],NULL);

textloc=atoi(output[i-2]);

textloc=textloc+start;

itoa(textloc,output[i-2],10);

for(n=0;n<(textloc-(tloc+tlen));n++)

{

strcpy(obcode[inc].add,"xx");

obcode[inc++].locctr=location++;

}

tlen=atoi(output[i-1]);

tloc=textloc;

k=0;

}

else

{

if(binary[k]==1)

{

num=0;

len=strlen(output[i]);

strcpy(address,NULL);

for(j=2;j<len;j++)

{

address[num]=output[i][j];

output[i][j]='\0';

num++;

}

loc=atoi(address);

loc=loc+start;

itoa(loc,address,10);

strcat(output[i],address);

}

k++;

len=strlen(output[i]);

num=0;

for(n=0;n<len;n++)

{

obcode[inc].add[num++]=output[i][n];

if(num>1)

{

obcode[inc++].locctr=location++;

num=0;

}

}

}

i++;

fscanf(fp1,"%s",input[i]);

}

strcpy(output[i],input[i]);

i++;

fscanf(fp1,"%s",input[i]);

loc=atoi(input[i]);

loc=loc+start;

strcpy(output[i],itoa(loc,address,10));

count=0;

i=0;

n=0;

fprintf(fp2,"%d\t",obcode[n].locctr);

for(n=0;n<inc;n++)

{

fprintf(fp2,"%s",obcode[n].add);

i++;

if(i>3)

{

fprintf(fp2,"\t");

i=0;

count++;

}

if(count>3)

{

fprintf(fp2,"\n%d\t",obcode[n+1].locctr);

count=0;

}

}

getch();

}

How do you deal with installing Java Access Bridge?

So, I followed every instruction in oracle, yet when I try to install a program(which needs access bridge) it gives me this error:

java.awt.AWTError: Assistive Technology not found: com.sun.java.accessibility.AccessBridge

I did absolutely EVERYTHING in the oracle site about 5 times. Still won't work. Anyone can help?