Question: Does anybody can help me to solve this java work? Thank you very much! Pre-laba Read the pre-lab and answer the questions before your lab

Does anybody can help me to solve this java work? Thank you very much!  Does anybody can help me to solve this java work? Thank
you very much! Pre-laba Read the pre-lab and answer the questions before
your lab session. This lab covers the following concepts: Important elements of
Java programs Outputting text to the Monitor Comments When writing any Java
program, there are a few bits of code that we will almost
always use. Every Java program needs at least one class. Classes are

Pre-laba Read the pre-lab and answer the questions before your lab session. This lab covers the following concepts: Important elements of Java programs Outputting text to the Monitor Comments When writing any Java program, there are a few bits of code that we will almost always use. Every Java program needs at least one class. Classes are like boxes where code is stored, and Java is a neat freak, so it requires that all code ends up in a class (after all, having piles ofcode scattered all over the floor would be rather messy, wouldn't it?). For our first few Java programs, we'll only have one class and only one code file. To tell Java that we're starting a class, we'd use a line of code like this: public class Puppy This tells Java that we'd like to create a class called Puppy. Don't worry about why the "public" is there, we'll deal with that later. After declaring and naming our class, we need to add a pair of curly braces, like so: public class Puppy These are like the walls of the code box. curly braces tell Java where blocks of code start and stop. Once we've got the curly braces in place, we need to add a method inside the class. Methods are bits of code that we write that we (or Java) can call on to execute certain tasks. Think of methods like little toys that we put inside our code box: each toy looks different from the others, and each toy does something different (e.g., some walk around the room, some make noise, and some torment your little brother by shooting Nerf darts at him). Methods are the same way. Each one gets a different name Gust like classes), and each onc usually does something related to its name. Every Java program needs to have at least one method called main, and we add it to our program like so

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!