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
dsp73
2 years ago
7

Define a class in Java to accept and store the list of 10 names in an array. Print the

Computers and Technology
1 answer:
dem82 [27]2 years ago
8 0

Answer:

public class Main

{

public static void main(String[] args) {

String[] strs = new String[10];

java.util.Scanner sc = new java.util.Scanner(System.in);

    for(int i = 0; i < 10; i++){

        System.out.print("Enter string " + (i+1) + ":");

        strs[i] = sc.nextLine();

    }

    System.out.println("The strigs with even number of characters is");

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

        if(strs[i].length() % 2 == 0){

            System.out.println(strs[i]);

        }

    }

}

}

Explanation:

You might be interested in
Using symbols in a file name is a good idea.<br><br> True<br> False
zavuch27 [327]
False. File names should only contain letters, underscores, periods, and dashes.
4 0
3 years ago
Read 2 more answers
Which option can be used to access more settings than are available in the Backstage view?
Sedaia [141]

Answer:

Orientation settings

Explanation:

Orientation setting or general settings, we can find more options in Excel, we can make general and even advance setting with these options in the backstage view, the language and tabs can be changed in this section, the options are:

  • General
  • Formulas
  • Proofing
  • Save
  • Language
  • Advanced
  • Customize Ribbon
  • Quick access toolbar
  • Add-ins
  • Trust Center
6 0
4 years ago
Read 2 more answers
Create an ArrayList of Employees (contain id and name) and add 3 Employees to the ArrayList to start. Next, you want to sort the
Anna [14]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't accept the symbol

Explanation:

Java code:

import java.util.*; public class Employees { // variables private int id; private String name; // getters public String getName() { return name; } public int getId() { return id; } // constructor public Employees(int id, String name) { this.id = id; this.name = name; } // comparator function based on the name static class compareByName implements Comparator<Employees> { "at"Override public int compare(Employees emp1, Employees emp2) { return emp1.getName().compareTo(emp2.getName()); } } // clone method for arraylist public static ArrayList<Employees> clone(ArrayList<Employees> arr) { ArrayList<Employees> temp = new ArrayList<Employees>(); for(int i=0;i<arr.size();i++) temp.add(arr.get(i)); return temp; } // main method public static void main(String[] args) { Scanner scan = new Scanner(System. in); // reading 3 employees details ArrayList<Employees> arr = new ArrayList<Employees>(); for(int i=0;i<3;i++) { System.out.print("Enter id: "); int id = scan. nextInt(); System.out.print("Enter name: "); scan. nextLine(); String name = scan. nextLine(); arr.add(new Employees(id,name)); } // cloning and sorting ArrayList<Employees> cloneArray = clone(arr); Collections. sort(arr, new compareByName()); // printing System. out. println("Array after cloning: "); for(int i=0;i<cloneArray. size();i++) { System.out.println(cloneArray. get(i). getId() + " " + cloneArray. get(i).getName()); } System. out. println("Array after sorting: "); for(int i=0;i<arr.size();i++) { System. out. println(arr.get(i). getId() + " " + arr.get(i). getName()); } } }  

Kindly check the attached images below for the code screenshot and code output.

3 0
3 years ago
In a(n) ____, the programmer uses a programming language (in context free grammar) to tell the computer what to accomplish and h
Mamont248 [21]

A 5GL fifth-generation languages a programming language design to solve given problem without programmer. The user only needs to solve the problem and condition without implementing an algorithm.

Explanation:

First Generation Language

The first generation language is called low- level style because they were used at a superficial level of abstraction. First-generation language referred to as the native language.

Second Generation Language

The second-generation language is also low-level language or assembly language. The second level of language uses the concept of mnemonics for the writing program. Symbolic name are used.

Third Generation Language

The third-generation language overcomes the first and second-generation languages. Third generation language is considered as high- level language because the target is to focus on the logic of the program.

Fourth Generation Language

The language of generation required a lot of time and effort that affect programmers.The fourth-generation was developed to reduce the time, cost, and effort.

Fifth Generation Language

The programming language of this generation focuses on constraints programming. The fifth-generation programming languages are Artificial Intelligence and Artificial Neural Network.

6 0
3 years ago
The Table portion of the Ribbon is made of up three tabs: Design, Layout, and Structure.
konstantin123 [22]

Answer:

False

Explanation:

5 0
4 years ago
Other questions:
  • What is requirement analysis
    8·1 answer
  • 40 is 20 % percent of what?​
    9·1 answer
  • What is generation of computer ​
    15·2 answers
  • Why won’t my Nintendo Switch connect to the internet?
    7·1 answer
  • Asymmetric key encryption combined with the information provided by a. certificate authority allows unique identification of the
    8·1 answer
  • What are the defenses to protect against these attacks?
    13·1 answer
  • Lan is working on a project report that will go through multiple rounds of
    10·1 answer
  • Why are Quick Parts useful in an Outlook message?
    5·1 answer
  • Converting denary no 41 to binar
    12·1 answer
  • Ramesh goes to market for buying some fruits and vegetables .He
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!