All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
java an introduction to problem solving and progra
Questions and Answers of
Java An Introduction to Problem Solving and Progra
Which company currently maintains Java?
What do you call a method designed to be overridden that has a name, return type, and argument list, but no body?
Which networking protocols does the URL class support by default?
Can you use Java to download binary data from an online source?
What are the high-level steps to send form data to a web server using Java? Which classes are involved?
What class do you use to listen for incoming network connections?
When creating your own server like you did for the game, are there any rules for picking a port number?
Can a server application written in Java support multiple, simultaneous clients?
How many simultaneous servers can a given client Socket instance connect to?
Name the two main components that play a role in Java’s approach to securely running bytecode.
What command do you use to compile a Java source file?
How does the JVM know where to start when you run a Java class?
Can you extend more than one class when creating a new class?
Can you implement more than one interface when creating a new class?
Which class represents the main window in a graphical application?
What statement gives you access to the Swing components in you application?
What environment variable determines where Java will look for class files when compiling or executing?
What options do you use to look at the contents of a JAR file without unpacking it?
What entry is required in the MANIFEST.MF file to make a JAR file executable?
Implement Euclid’s GCD algorithm as a full class named Euclid. Recall the basics of the algorithm: For your output, can you think of a way to show the user the original values of a and b in
If you’re up for a bit more of a challenge, try arranging the output in a visual triangle. The statement above prints one element on a line by itself. The built-in System. out object has another
What tool allows you to try out Java code in an interactive fashion?
What text encoding format is used by default by Java in compiled classes?
Try creating the triangular array from the previous section into a simple class or in jshell. Here’s one way: Now expand that code to print the contents of triangle to the screen. To help, recall
What characters are used to enclose a multiline comment? Can those comments be nested?
Which looping constructs does Java support?
If you wanted to store the US stock market’s total capitalization (roughly $31 trillion at the close of fiscal year 2022) as whole dollars, what primitive data type could you use?
In a chain of if/else if tests, what happens if multiple conditions are true?
What does the expression 18 - 7 * 2 evaluate to?
How would you create an array to hold the names of the days of the week?
Now add your own animal to the zoo. Create a new inner class similar to Lion. Fill in the appropriate sound for your animal, and add them to the output section of the listen() method. Your new output
What is the primary organizing unit in Java?
What operator do you use to create an object (or instance) from a class?
Java does not support classic multiple inheritance. What mechanisms does Java provide as alternatives?
How can you organize multiple, related classes?
How do you include classes from other packages for use in your own code?
What do you call a class defined inside the scope of another class? What are some features that make such a class useful in some circumstances?
What is an overloaded method?
If you want to make sure no other class can use a variable you have defined, what access modifier should you use?
What statement should you use to manage potential exceptions in your code?
Which exceptions does the compiler require you to handle or throw?
Where do you place any cleanup code that you want to always run after using some resources in a try block?
Do assertions have much of a performance penalty when they are disabled?
If you want to store a contact list with names and phone numbers, which kind of collection would work best?
What method do you use to get an iterator for the items in a Set?
How can you turn a List into an array?
How can you turn an array into a List?
What interface should you implement to sort a list using the Collections. sort() method?
Which class contains the constant π? Do you need to import that class to use π?
Which package contains better replacements for the original java.util.Date class?
Which class should you use to format a date for user-friendly output?
What symbol would you use in a regular expression to help match the words “yes” and “yup”?
How would you convert the string “42” into the integer 42?
How would you compare two strings (such as “yes” and “YES”) to see if they match, ignoring any capitalization?
Which operator concatenates strings?
What flags allow you to compile a Java program that includes preview feature code?
What flags allow you to run a Java program that includes preview feature code?
How many platform threads can one native thread support?
How many virtual threads can one native thread support?
Is the statement x = x + 1; an atomic action for the variable x?
What package includes thread-safe versions of popular collection classes like Queue and Map?
Using the classes of the java.io package, create a small program that will print the size of a file specified on the command line. For example:If no file argument is given, print an error message to
How could you check to see if a given file already exists?
If you have to work with a legacy text file using an old encoding scheme, such as ISO 8859, how might you set up a reader to properly convert that content to something like UTF-8?
Which package has the best classes for nonblocking file I/O?
Which type of input stream might you use to parse a binary file, such as a JPEG-compressed image?
What are the three standard text streams built into the System class?
How do you retrieve a NIO channel from an existing FileInputStream?
Which package contains the majority of functional interfaces introduced in Java 8?
Do you need to use any special flags when compiling or running Java applications that use functional features like lambdas?
How do you create lambda expressions with multiple statements in the body?
Can lambda expressions be void? Can they return values?
Can you reuse a stream after you have processed it?
How might you take a stream of objects and convert it to a stream of integers?
If you have a stream that filters out empty lines from a file, what operation might you use to tell you how many lines had some content?
Which component would you use to display some text to the user?
Which component(s) would you use to allow the user to enter text?
What event does clicking a button generate?
Which listener should you attach to JList if you want to know when the user changes the selected item?
What is the default layout manager for JPanel?
Which thread is responsible for processing events in Java?
What method would you use to update a component like JLabel after a background task completes?
What container holds JMenuItem objects?
What is the name of the open source development kit for Java?
Write some code that will use an iterator to move the first item in an instance of StringLinkedListWithIterator (Listing 12.9) to the end of the list. For example, if the list contains "a", "b", "c",
Write an algorithm that finds the maximum value in a list of values.
Repeat the previous question, but use the comma operator and omit the for statement’s body.
Consider a Java class that you could use to get an acceptable integer value from the user. An object of this class will have the attributesMinimum accepted value Maximum accepted
Rewrite the Dog class given in Listing 5.1 by utilizing the information and encapsulation principles described in Section 5.2. The new version should include accessor and mutator methods. Also define
Consider a class Time that represents a time of day. It has attributes for the hour and minute. The hour value ranges from 0 to 23, where the range 0 to 11 represents a time before noon.The minute
Complete and fully test the class Time that Exercise 2 describes. Add two more constructors that are analogous to the setTime methods described in Parts c and d of Exercise 2. Also include the
Write a default constructor and a second constructor for the class RatingScore, as described in Exercise 9 of the previous chapter.Exercise 9Consider a class RatingScore that represents a numeric
Complete and fully test the class Characteristic that Exercise 5 describes. Include the following methods:getDescription—returns the description of this characteristic.getRating—returns the
Write a constructor for the class ScienceFairProjectRating, as described in Exercise 10 of the previous chapter. Give this constructor three parameters corresponding to the first three attributes
Consider a class Characteristic that will be used in an online dating service to assess how compatible two people are. Its attributes aredescription—a string that identifies the
Complete and fully test the class Person that Exercise 10 describes. Include the following additional methods:getName—returns the name of the person as a string.getAge—returns the age of the
Create a class RoomOccupancy that can be used to record the number of people in the rooms of a building. The class has the attributesnumberInRoom—the number of people in a roomtotalNumber—the
Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number for the temperature and a character for the scale: either 'C' for Celsius
Write a program that tests the class RoomOccupancy described in the previous exercise.Previous exercise.Create a class RoomOccupancy that can be used to record the number of people in the rooms of a
In the previous chapter, Self-Test Question 16 described a class Person to represent a person. The class has instance variables for a person’s name, which is a string, and an integer age. These
Showing 1 - 100
of 407
1
2
3
4
5