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
Over [174]
1 year ago
15

try the following code to see a nullpointer error (if you don’t see the error because of the autograding, you can copy it into t

he pencil icon scratch area to run it without the grader). since s is null, indexof throws an nullpointer error for s. comment out the first if statement and run the program again. the second if statement avoids the error with shortcircuit evaluation. because s !
Computers and Technology
1 answer:
gavmur [86]1 year ago
4 0

Using the knowledge of computational language in JAVA it is possible to describe  since s is null, indexof throws an nullpointer error for s. comment out the first if statement and run the program again. the second if statement avoids the error with shortcircuit evaluation.

<h3>Writting the code:</h3>

<em>public class Printer {</em>

<em>    private String name;</em>

<em>    public void print() {</em>

<em>        </em><em>printString</em><em>(name);</em>

<em>    }</em>

<em>public class Example {</em>

<em />

<em>    public static void </em><em>main</em><em>(String[] args) {</em>

<em>        Object obj = null;</em>

<em>        obj.hashCode();</em>

<em>    }</em>

<em />

<em>}</em>

<em>    public static void </em><em>main</em><em>(String[] args) {</em>

<em>        Printer printer = new Printer();</em>

<em>        printer.print();</em>

<em>    }</em>

<em>}</em>

<em>    }</em>

<em>public class Example {</em>

<em />

<em>    public static </em><em>void </em><em>main(String[] args) {</em>

<em>        Object obj = null;</em>

<em>        obj.hashCode();</em>

<em>    }</em>

<em />

<em>}</em>

<em>    public static void </em><em>main</em><em>(String[] args) {</em>

<em>        Printer printer = new Printer("123");</em>

<em>        printer.print();</em>

<em>    }</em>

<em>}</em>

See more about python at brainly.com/question/19705654

#SPJ1

You might be interested in
Select the correct answer. Nancy has made a small web page with the new features of HTML5. She has to show this web page in scho
Tasya [4]

Answer:

IE 10

Explanation:

It is the newest version in the list of options

8 0
3 years ago
What is a disadvantage of shopping online?A.Harder to compare prices than in storesB.A higher risk of financial data theftC.More
babymother [125]

.A higher risk of financial data theftC

7 0
3 years ago
Read 2 more answers
Which feature of dart helps in making the code readable,maintainable and finds type error during compile time
devlian [24]

Answer:

Sound

Explanation:

Dart is object oriented. It's sound feature helps to make codes more maintainable and readable. The sound type system means that one can never experience w state where where an expression would evaluate to a value that wouldn't match that expressions static type.

The sound system makes the code to be unambiguous. It makes the code to be easier to read as types cannot lie, also your code would be more maintainable since when a piece of code gets to be changed, you would be warned of other pieces that may have gotten broken.

3 0
3 years ago
Which of the following is not a true statement about Christopher Columbus it oko
Thepotemich [5.8K]

Answer:

  • There has been a need to explore the different regions across the globe in the early ages, as there were ships to travel but there was no one before who knew about the different routes and maps of the region, so, it was sort of blind folded traveling when some one wanted to go far distances yet some of them knew about other regions on the far sides of many seas having a unique culture, different languages, along with having diversity among the flora and fauna inside the region.
  • So, like many other curious people across the globe there was a need for the people to explore all the regions. As, it was a need for the travelers and all the rest of free fork to know about this world. Now, every wanted to know more about the different lands but there were few who even performed the great feat, as they had fear for their lives.While, Christopher Columbus was more into sacrificing his own life in order to explore the lands at the far lands across the Pacific ocean. As, he arranged his mind and covered all the required arrangements for the journey.
  • As, was at first wanted to explore the lands of far east and thus wanted to more about the Subcontinent India, but in turn he reached the lands of the American continent in far west.While, upon arriving the American region we say many people with different skin tone, culture and language which was very different then he heard about the people of India.There was more different world then he could ever think of as he had a lot to tell about these lands upon the way back to Europe or his home land.

7 0
3 years ago
TLE 10 - ICT
Kipish [7]

Answer:

Information And Communication Technology

5 0
2 years ago
Other questions:
  • Consider a movie database in which data is recorded about the movie industry. the data requirements are summarized as follows:
    15·1 answer
  • You are configuring a switch that has three hosts attached to FastEthernet 0/2 through 0/4. All three hosts are part of a public
    10·1 answer
  • According to the Computing Research Association, the number of undergraduate degrees awarded in computer science at doctoral-gra
    11·1 answer
  • (PYTHON HOMEWORK)Given the following code snippet, which statement tests to see if all three sets are equal?:
    11·1 answer
  • All 24-point fonts take up the same amount of space on a slide. True False
    7·2 answers
  • Random Access Memory is tempory computer memory that stores works in progress
    7·1 answer
  • Explain the look of a document which contains several different font sizes and font colors​
    13·1 answer
  • Which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
    12·1 answer
  • Group of programs are software <br>​
    11·1 answer
  • Which family does Ms word 2007 belongs to?​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!