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 are real constants in java?

"real" numbers, in any programming language, are actually approximations of what is called a "real number" in math. Basically, a number that can handle decimals - but unlike the actual real numbers, of limited precision.

In Java, the "real" data types are float, and double. double has greater precision.

A "constant" in Java is similar to a variable, but its value can't be changed after it has been assigned a value.

What parameters decide the size of data type for a processor?

Some bits of machine instruction code. Of course it is platform-dependent.

Read a string and rewrite in alphabetical order?

Well, I don't know how to rewrite a string in alphabetical order with a function, but I think I know a way to get around it. Try it first before you put it in something. Also, if you need to do it often, make it into a function...

//is an example string

var myName = "jake";

//makes myName into an array that is "j", "a", "k", "e"

var myName_array = myName.split("");

//this changes it into "a", "e", "j", "k";

var myName_array_alphabetical = myName_array.sort();

//and this makes it back into a string."aejk"

var myName_alphabetical = myName_array_alphabetical.join("")

Coding of calculator programme using switch case in java?

import java.io.*;


public class calculator{
public static void main(String[] args) throws Exception{
int x, y;
BufferedReader b = new BufferedReader(new InputStreamReader(System.in)) ;
System.out.println("Enter two numbers for operation:");


x = Integer.parseInt(b.readLine());
y = Integer.parseInt(b.readLine());
System.out.println("1. Add");
System.out.println("2. Subtract");
System.out.println("3. Multiply");
System.out.println("4. Divide");
System.out.println("enter your choice:");
int a= Integer.parseInt(b.readLine());
switch (a){
case 1:
System.out.println("Enter the number one=" + (x+y));
break;
case 2:
System.out.println("Enter the number two=" + (x-y));
break;
case 3:
System.out.println("Enetr the number three="+ (x*y));
break;
case 4:
System.out.println("Enter the number four="+ (x/y));
break;
default:
System.out.println("Invalid Entry!");
}






}
}

Write a program to display a table of 5?

#include <stdio.h>

#include<conio>

void main ()

{int a,i:,

printf("\n The Multiplication table of 5 is n"):,

For(i=1;i=20;i++)

Printf("%d",a*i);

getch();

}

Who discover java?

Java was originally developed by James Gosling at Sun Microsystems.

How much storage data exists today in characters or bytes?

It is impossible to conjure an accurate number. However, an assumption was made with the Digital Universe Study found in the related link, stating there were an estimated 1.8 Billion Terabytes in existence.

Create a program in java that will accept 2 strings and display in concatenated form?

class demo {

public static void main(String[] args) { if(args.length == 2) {

System.out.println(args[0] + args[1]);

} else {

System.out.println("Usage: demo Str1 Str2");

}

}

What is the magic behind good typing?

Just pay attention to the keyboard at all times and pay attention to your teacher

That goes for people in middle school

When a subclass can call a parent's class constructor?

A subclass invokes its base class constructor at the point of instantiation. That is; you cannot instantiate a subclass object without first constructing its base class, which is done automatically.

Who inverted the java?

java was invented by james gosling.

What is an anonymous class?

An anonymous class is a local class without a name. An anonymous class is defined and instantiated in a single succinct expression using the new operator. While a local class definition is a statement in a block of Java code, an anonymous class definition is an expression, which means that it can be included as part of a larger expression, such as a method call. When a local class is used only once, consider using anonymous class syntax, which places the definition and use of the class in exactly the same place.

New Syntax for Anonymous Classes

We've already seen examples of the syntax for defining and instantiating an anonymous class. We can express that syntax more formally as: new class-name ( [ argument-list ] ) { class-body }

or: new interface-name () { class-body }

For an if then else loop how do you include more than one condition?

You can combine more than one condition with AND or with OR. How this is written depends on the particular programming language.

You can also have several cases; example in Java:

if (condition1)

{

command1;

}

else if (condition2)

{

command2;

{

else

{

command3;

}

Does the derived class take the memory of base class in inheritance?

Yes, the derived class includes the memory of the base class. The derived class inherits everything in the base class, data and function, and provides additional data and function as needed.

What is the ' ' called in java?

' ' would be the character for a space in Java.

What is the difference between java ring and smart card?

iButtons have an advantage over conventional smart cards in term of durability and longevity.

iButtons are rugged enough to withstand harsh environments. iButton uses java as a common programming language.

What is logical statement?

A logical statement is one that will return a boolean or a logical "True" or "False" output. It is used in cases where conditions need to be executed.

For ex: lets say you write a system that checks the age of the visitors to a bar, the system should only allow people who are over 18 yrs of age. So the logical condition will be like below:

if(age > 18) then "Let the Customer Enter"

else "The customer is a minor, send them back to stay out of trouble"