Question

Part Two: Fill in the Blanks and True/False (24 total points - 2 points each) For each of the following, fill in the most app

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution for the above questions :

Fill in the blanks :

  1. Keyword, literals and identifier are all kinds of tokens, which are group of characters.
  2. 11- 2*3 = 5 as computed according to bodmas rule.
  3. Precedence of logical operators in java is as follows : ! > && > ||
  4. Two types : Primitive(int. char, etc.) and Non primitive (also known as Reference data types eg. String, array objects)
  5. Setters and Getters method which are used to change data or retrieve data of an object.
  6. Not sure
  7. Java arrays are contiguous and collection of similar data types.

True or False :

  1. False : In java it is okay to store int value in float variable but not vice versa because loss of data may take place if we try to store larger float values in smaller int variable but in other case imlicit type conversion takes place and no data loss is suffered.
  2. True : Java instance variables are automatically initialised but not method variables.
  3. True : In switch case the case that matches the switch variable will only work. But if there is no break statement used then more cases can work, this condition is called fall through.
  4. True : the scope of method variable is inside the block of method in which it is declared.
  5. True : As file size is determined by the length of text in the file or number of texts in the file so here both will take same space

We are instructed to answer 4 subparts only but i have answered all the questions which i could answer.

Happy learning !!

Add a comment
Know the answer?
Add Answer to:
Part Two: Fill in the Blanks and True/False (24 total points - 2 points each) For...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal...

    Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal '2', a string literal "2", and the numeric literal 2 are identical and stored the same way though they are different types. 3 Since comments do not affect the program execution, you don't need to have it at all. 4. After the following statements are executed, the value of the variable rem is 3. 1. A preprocessor directive line starts with a pound sign...

  • Create an abstract class “Appointment” that represents an event on a calendar. The “Appointment” class will...

    Create an abstract class “Appointment” that represents an event on a calendar. The “Appointment” class will have four instance variables: • An instance variable called “year” which will be of type int • An instance variable called “month” which will be of type int • An instance variable called “day” which will be of type int • An instance variable called “description” which will be of type String The “Appointment” class must also implement the following methods: • A getter...

  • QUESTION 1 Each class must be declared in its own .java file True or False? QUESTION...

    QUESTION 1 Each class must be declared in its own .java file True or False? QUESTION 2 The keyword this must always be explicitly used when referring to an object's instance variables and methods from within one of its non-static methods. True or False? QUESTION 3 When used in a class' main method the this keyword references the object representing the class itself. True or False? QUESTION 4 Accessor methods that test whether a condition is true or false are...

  • review for the final 1. (1 point) Mark True or False in the left side of...

    review for the final 1. (1 point) Mark True or False in the left side of problems. (1) We can declare an array of string as string) greetings = {"good", "excellent"); (2) To declare and initialize an int variable i to be 2, we can write int=2; (3) For a properly declared and initialized int variable num, a condition to represent that num is between 10, 100) is written as (num >= 0 || num < 100). (4) Every nested...

  • Java Time Class Class declarations are one of the ways of defining new types in Java....

    Java Time Class Class declarations are one of the ways of defining new types in Java. we will create two classes that both represent time values for a 24 hours period. The valid operations are as follows. int getHours(): returns the number of hours int getMinutes(): returns the number of minutes int getSeconds(): returns the number of seconds String toString(): returns a String representation boolean equals(Time other): returns true if and only if other designates an object that has the...

  • Lab 7 Add three instance variables to your class RightTriangle from lab 5. The first two...

    Lab 7 Add three instance variables to your class RightTriangle from lab 5. The first two are of type int and are called xLoc and yLoc and the third is of type int called ID. Also add a static variable of type double called scaleFactor. This should be initialized to a default value of 1. Update the constructor to set the three new instance variables and add appropriate get and set methods for the four new variables. All set methods...

  • Question 2 [5 points) State if each of the below statements is True or False 1...

    Question 2 [5 points) State if each of the below statements is True or False 1 2 3 The Compiler skips comments. A function can return a value of type array. An array index starts with 1. Pass by value is the default in CH, except when passing arrays as arguments to function The default storage class for local variables is static. A pointer provides an indirect means of accessing the value of a particular data item The logical operators...

  • 1. Assume you have a Car class that declares two private instance variables, make and model....

    1. Assume you have a Car class that declares two private instance variables, make and model. Write Java code that implements a two-parameter constructor that instantiates a Car object and initializes both of its instance variables. 2. Logically, the make and model attributes of each Car object should not change in the life of that object. a. Write Java code that declares constant make and model attributes that cannot be changed after they are initialized by a constructor. Configure your...

  • Java Object Array With 2 Elements In 1 Object

    1. Create a UML diagram to help design the class described in Q2 below. Do this exercise before you attempt to code the solution. Think about what instance variables will be required to describe a Person class object; should they be private or public? Determine what class methods are required; should they be private or public?2. Write Java code for a Person class. A Person has a name of type String and an age of type integer.Supply two constructors: one will be...

  • Question 22 4 pts In the statement: Int'. p and q are pointer variables. True False...

    Question 22 4 pts In the statement: Int'. p and q are pointer variables. True False D Question 23 4 pts If a user-defined class object that uses mathematical operators to pass to the template function, the class must contain code for the primitive data types the constructor the overloaded operators the try/catch blocks Question 24 4 pts Afriend function is a function that is not part of a class but has access to the class's private members as well...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT