1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivanshal [37]
3 years ago
7

Analyze the following code: class Test { public static void main(String[] args) { System.out.println(xMethod((double)5)); } publ

ic static int xMethod(int n) { System.out.println("int"); return n; } public static long xMethod(long n) { System.out.println("long"); return n; } }
Computers and Technology
1 answer:
SashulF [63]3 years ago
3 0

Answer:

This code will give Error.

Explanation:

This code will give error because we have passed the argument 5 as double by using typecasting.We have two methods named xMethod but with arguments as int and long none of them has argument as double.The compiler will not be able to find the method with double argument.So this code will not run because of this reason.

You might be interested in
Which behaviors demonstrate good netiquette? Check all that apply.
Andru [333]

Answer:

identifying yourself in a post or e-mail

writing short

respecting others privacy

Explanation:

3 0
3 years ago
Identity theft, where people steal personal information, continues to be a problem for consumers and businesses. Assume that you
svetlana [45]

Answer:

Secure the personal information with complex multi-factor authentication and configure intrusion detection and prevention and a firewall.

Explanation:

Multi-factor authentication is a method of securing a client's personal information from the client's side to the data centre. It uses more than one security processes not policies. There key be three authentications process like a password, security token and biometrics or two authentications like password and biometrics or token.

The firewall and intrusion detection and prevention are vulnerability preventive method to detect and stop cyber attacks.

5 0
3 years ago
Need help coding this it uses input and I need to use the words good and morning
Masja [62]

Answer:

x = input ("Enter a word: ")

y = input ("Enter a word: ")

print ( x, " ", y)

Explanation:

This is the simplest way to write it using Python.

6 0
2 years ago
What is the first thing you need to do to edit a graph?
Kay [80]
Know the numbers and info
3 0
2 years ago
Read 2 more answers
JAVA PROGRAMMING
VashaNatasha [74]

Answer:

See explaination

Explanation:

import java.util.Scanner;

public class GtldValidation {

public static void main (String [ ] args) {

Scanner scnr = new Scanner(System.in);

// Define the list of valid core gTLDs

String [ ] validCoreGtld = { ".com", ".net", ".org", ".info" };

// FIXME: Define an array named validRestrictedGtld that has the names

// of the restricted domains, .biz, .name, and .pro

String [] validRestrictedGtld={".biz",".name",".pro"};

String inputName = "";

String searchName = "";

String theGtld = "";

boolean isValidDomainName = false;

boolean isCoreGtld = false;

boolean isRestrictedGtld = false;

int periodCounter = 0;

int periodPosition = 0;

int i = 0;

System.out.println("\nEnter the next domain name (<Enter> to exit): ");

inputName = scnr.nextLine();

while (inputName.length() > 0) {

searchName = inputName.toLowerCase();

isValidDomainName = false;

isCoreGtld = false;

isRestrictedGtld = false;

// Count the number of periods in the domain name

periodCounter = 0;

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

if (searchName.charAt(i) == '.') {

++periodCounter;

periodPosition = i;

}

}

// If there is exactly one period that is not at the start

// or end of searchName, check if the TLD is a core gTLD or a restricted gTLD

if ((periodCounter == 1) &&

(searchName.charAt(0) != '.') &&

(searchName.charAt(searchName.length() - 1) != '.')) {

isValidDomainName = true;

}

if (isValidDomainName) {

// Extract the Top-level Domain name starting at the period's position. Ex:

// If searchName = "example.com", the next statement extracts ".com"

theGtld = searchName.substring(periodPosition);

i = 0;

while ((i < validCoreGtld.length) && (!isCoreGtld)) {

if(theGtld.equals(validCoreGtld[i])) {

isCoreGtld = true;

}

else {

++i;

}

}

// FIXME: Check to see if the gTLD is not a core gTLD. If it is not,

// check to see whether the gTLD is a valid restricted gTLD.

// If it is, set isRestrictedGtld to true

}

System.out.print("\"" + inputName + "\" ");

if (isValidDomainName) {

System.out.print("is a valid domain name and ");

if (isCoreGtld) {

System.out.println("has a core gTLD of \"" + theGtld + "\".");

}

else if (isRestrictedGtld) {

System.out.println("has a restricted gTLD of \"" + theGtld + "\".");

}

else {

System.out.println("does not have a core gTLD."); // FIXME update message

}

}

else {

System.out.println("is not a valid domain name.");

}

System.out.println("\nEnter the next domain name (<Enter> to exit): ");

inputName = scnr.nextLine();

}

return;

}

}

8 0
3 years ago
Other questions:
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    8·1 answer
  • Using the expected format, of putting key information where the reader can’t find it, is an example of?
    8·2 answers
  • Which ones are right
    15·1 answer
  • One guideline for writing content for the web is to use ____ space to visually separate sections of content.
    15·1 answer
  • What are lexical errors?<br> and fi(a==b)<br> will it be a lexical error or a syntactical error?
    8·1 answer
  • Which of the following must be configured in certain applications to help ensure data aggregation and data isolation are impleme
    15·1 answer
  • Design a flowchart for an algorithm which adds prim numbers starting from 1 up to 50. Change
    9·1 answer
  • This is Very very Important to me[BRAINLIEST)✅​
    5·1 answer
  • A technology _________ occurs when the ability of a company to operate is impaired because of a hardware, software, or data outa
    7·1 answer
  • Distinguish<br> between formal and Informal<br> Information System<br> Information systems
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!