What is an element in the Array?
An array is a container object that holds a fixed number of values of a single type. ... Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the preceding illustration, numbering begins with 0. The 9th element, for example, would therefore be accessed at index 8.
it is a unused for years slang for a coffee party ja being slang for java
"Head" is a term given to the weight and resulting pressure of a column of liquid above a given point in the system. Static head means that the head pressure is measured with no liquid actually flowing. Dynamic head would be the pressure of the liquid while it is actually flowing.
How is an applet started by a browser?
Once you have made the applet, you need to make an HTML file to launch the applet. Search google for examples, it's only about 3 lines of code
Java variable types and controls?
Java is a powerful language that gives us options to have data in different forms. We have several data types that we can use for our needs. The basic data types that java offers us are termed as Primitive Data Types. Though all programming languages have varied data types java offers us with a variety of data types that are much powerful and simplified to use when compared to other languages.
The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. This involves stating the variable's type and name.
int age = 10;
The above statement tells the java compiler that a field named "age" which holds numeric data and having an initial value of 10 is declared. A variable's data type determines the values it may contain, plus the operations that may be performed on it. In addition to int, the Java programming language supports seven other primitive data types. A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other primitive values. The eight primitive data types supported by the Java programming language are:
byte, short, int, long, float, double, char and boolean
Write a java code to draw a circle inside in an ellipse?
write a program draw circle and ellipse by using oval methods in java
Run time errors or syntax errors are most easy to locate, since the compiler will show you where the errors are. A logic error would be more difficult to locate, since the program runs but does not compute the desired result.
are some types of jdbc drivers
What modifier do you use to prevent that class from having any subclasses?
In Java, you use the final modifier to prevent a class from having any subclasses.
So for as i know, it depends on the first argument which represents the number of arguments. If argc is 2 bytes in length, 65535 strings can be passed. If argc is 4 bytes in length, 4294967295 strings can be passed. In Both the cases first one is for program name. And the total length should not exceed the heap size.
S.Sunil kumar,MCA(2008-2011) from CEG, Anna University
Answer: OS dependent, for example in DOS only 127
What is a random number and how are generated?
Random numbers that are generated by a computer are pseudo-random (not really random), but they will pass enough statistical tests for randomness to be useful in simulation random processes. Java has random number generators in the standard libraries.
See the related link if you need more information.
What command executes the Java class file Welcomeclass?
I assume you meant Welcome.class, in which case, it would be:
java Welcome
Convert input number to word in java codes?
//By rohan import java.text.DecimalFormat; public class EnglishNumberToWords { private static final String[] tensNames = { "", " ten", " twenty", " thirty", " forty", " fifty", " sixty", " seventy", " eighty", " ninety" }; private static final String[] numNames = { "", " one", " two", " three", " four", " five", " six", " seven", " eight", " nine", " ten", " eleven", " twelve", " thirteen", " fourteen", " fifteen", " sixteen", " seventeen", " eighteen", " nineteen" }; private static String convertLessThanOneThousand(int number) { String soFar; if (number % 100 < 20){ soFar = numNames[number % 100]; number /= 100; } else { soFar = numNames[number % 10]; number /= 10; soFar = tensNames[number % 10] + soFar; number /= 10; } if (number == 0) return soFar; return numNames[number] + " hundred" + soFar; } public static String convert(long number) { // 0 to 999 999 999 999 if (number == 0) { return "zero"; } String snumber = Long.toString(number); // pad with "0" String mask = "000000000000"; DecimalFormat df = new DecimalFormat(mask); snumber = df.format(number); // XXXnnnnnnnnn int billions = Integer.parseInt(snumber.substring(0,3)); // nnnXXXnnnnnn int millions = Integer.parseInt(snumber.substring(3,6)); // nnnnnnXXXnnn int hundredThousands = Integer.parseInt(snumber.substring(6,9)); // nnnnnnnnnXXX int thousands = Integer.parseInt(snumber.substring(9,12)); String tradBillions; switch (billions) { case 0: tradBillions = ""; break; case 1 : tradBillions = convertLessThanOneThousand(billions) + " billion "; break; default : tradBillions = convertLessThanOneThousand(billions) + " billion "; } String result = tradBillions; String tradMillions; switch (millions) { case 0: tradMillions = ""; break; case 1 : tradMillions = convertLessThanOneThousand(millions) + " million "; break; default : tradMillions = convertLessThanOneThousand(millions) + " million "; } result = result + tradMillions; String tradHundredThousands; switch (hundredThousands) { case 0: tradHundredThousands = ""; break; case 1 : tradHundredThousands = "one thousand "; break; default : tradHundredThousands = convertLessThanOneThousand(hundredThousands) + " thousand "; } result = result + tradHundredThousands; String tradThousand; tradThousand = convertLessThanOneThousand(thousands); result = result + tradThousand; // remove extra spaces! return result.replaceAll("^\\s+", "").replaceAll("\\b\\s{2,}\\b", " "); } /** * testing * @param args */ public static void main(String[] args) { System.out.println("*** " + EnglishNumberToWords.convert(0)); System.out.println("*** " + EnglishNumberToWords.convert(1)); System.out.println("*** " + EnglishNumberToWords.convert(16)); System.out.println("*** " + EnglishNumberToWords.convert(100)); System.out.println("*** " + EnglishNumberToWords.convert(118)); System.out.println("*** " + EnglishNumberToWords.convert(200)); System.out.println("*** " + EnglishNumberToWords.convert(219)); System.out.println("*** " + EnglishNumberToWords.convert(800)); System.out.println("*** " + EnglishNumberToWords.convert(801)); System.out.println("*** " + EnglishNumberToWords.convert(1316)); System.out.println("*** " + EnglishNumberToWords.convert(1000000)); System.out.println("*** " + EnglishNumberToWords.convert(2000000)); System.out.println("*** " + EnglishNumberToWords.convert(3000200)); System.out.println("*** " + EnglishNumberToWords.convert(700000)); System.out.println("*** " + EnglishNumberToWords.convert(9000000)); System.out.println("*** " + EnglishNumberToWords.convert(9001000)); System.out.println("*** " + EnglishNumberToWords.convert(123456789)); System.out.println("*** " + EnglishNumberToWords.convert(2147483647)); System.out.println("*** " + EnglishNumberToWords.convert(3000000010L)); /* OUTPUT WILL BE LIKE THIS *** zero *** one *** sixteen *** one hundred *** one hundred eighteen *** two hundred *** two hundred nineteen *** eight hundred *** eight hundred one *** one thousand three hundred sixteen *** one million *** two millions *** three millions two hundred *** seven hundred thousand *** nine millions *** nine millions one thousand *** one hundred twenty three millions four hundred ** fifty six thousand seven hundred eighty nine *** two billion one hundred forty seven millions ** four hundred eighty three thousand six hundred forty seven *** three billion ten **/ } }
Which package is heavier 85 g or 2oz?
Data in computers is not measured in grams...However, to answer your question, 85 grams is heavier; 2 ounces is 56.69 grams when converted.
The Java Foundation Classes (JFC) are a comprehensive set of GUI components and services which dramatically simplify the development and deployment of commercial-quality desktop and Internet/Intranet applications.
Can a DateTime variable be null?
hi i can say that datetime cant be null because datetime is valuetyp(struct) its not referece type(object)
guys ..... instead of using actual pointer arguments i have used parameters ...
this will give you a far better idea of using pointers ........and i have used setbuf function because i am using emacs , it buffers output !!...... just enjoy
#include<stdio.h>
#include<string.h>
void main()
{
char ch,str[25],del[25];
char *p,*q,*r;
int i;
setbuf(stdout,NULL);
printf("\nenter the string:-\n");
gets(str);
setbuf(stdout,NULL);
printf("\nenter the character:-\n");
gets(&ch);
p=str;
r=del;
q=&ch;
delete(p,q,r);
printf("\nthe string with the deleted characters is:-\n%s",del);
}
delete(char *p,char *q,char *r)
{
while(*p!='\0')
{
if(*p!=*q)
{
*r=*p;
r++;
p++;
}
else
{
p++;
continue;
}
}
*r='\0';
}
Give some examples of keywords?
What is the process of assigning a value to a variable called?
That is called "assignment".
That is called "assignment".
That is called "assignment".
That is called "assignment".
How do you write a program in Java to check whether a number is a pal prime or not?
import java.io.*;
class PalPrime
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int x;
void inputData(int X)throws IOException
{
x=X;
}
int Pal(int y)
{
int a=y,b=0,rev=0;
while(a>0)
{
b=a%10;
rev=rev*10+b;
a=a/10;
}
if (rev==y)
return 1;
else
return 2;
}
boolean Prime(int m)
{
int c=0;
for(int i=1;i<=m;i++)
{
if (m%i==0)
c++;
}
if (c==2)
return true;
else
return false;
}
void main()throws IOException
{
System.out.println("Enter a 4 digit no");
int X=Integer.parseInt(br.readLine());
inputData(X);
System.out.println("Enter the same no. again");
int y1=Integer.parseInt(br.readLine());
Pal(y1);
System.out.println("Enter the same no. again");
int m1=Integer.parseInt(br.readLine());
Prime(m1);
if (Pal(y1)==1 && Prime(m1)==true)
System.out.println(x+" is a Pal-Prime No.");
else
System.out.println(x+" is not a Pal-Prime No.");
}
}
Can you overload plus equals in java?
yes to over load plus in java by using arthamatic operation we can perform it
In ANSI C you can hide data by using private access specifier Justify?
One can always declare a datatype as static which will limit the scope to the file only. this way data hiding can be achived. For more clearance on the same please refer 'the C programming language'.
Data hiding means only relevant data is visible to the user and all the background information is hidden from the user. In c++, the variables are named as data members and these can be hidden with the help of private access specifier.
In procedural languages, variables(global variables) are free to flow from functions to functions and hence they were not secured. But in C++, only the class in which the data members are being declared can access them by using private specifier. As, the data members and also member functions of a class cannot be accessed outside the class if they have private access so, they get hidden from the user and hence the data hiding is achieved.
Also in inheritance when we derive a class from the base class then the derived class cannot access the private members of the base class. In addition, if a class is derived from another class privately i.e. for example syntax : class B : private A , is used then all the public and protected members (not private) becomes private to class B and cannot be accessed outside the class B, even by using the object of class B.
Hence, data hiding is achieved in C++ through private access specifier.