Which of the following is not the java keywords?
1)Abstract 2)Final 3)static 4)Long
Java language keywords are written in lowercase and Java language is case sensitive.
1) Abstract is not a java keyword (, whereas abstract is a java keyword).
2) Final is not a java keyword (, whereas final is a java keyword).
3) static is a java keyword.
4) Long is not a java keyword (, whereas long is a java keyword).
So, Abstract, Final, and Long are not the java keywords.
Which of the following is not the java keywords? 1)Abstract 2)Final 3)static 4)Long
For Java, 1. What is an abstract method? How is an abstract method created? 2. What is an abstract class? 3. Can an object of an abstract class be instantiated? 4. Does a superclass have access to the members of subclass? Does a subclass have access to the members of the superclass? 5. How do you prevent a subclass from having access to a member of a superclass? 6. Given the following hierarchy: class Alpha{ … class Beta extends Alpha...
Please answer 1-7 To declare a constant PI, you write: final static PI = 3.14159; final float PI = 3.14159; static double PI = 3.14159; final double PI = 3.14159; Which of the following is the correct expression of character a? 'a' "a" \000a" None of the above. Which of the following operators has the highest precedence? casting + */What is 1 % 2? 0 1 2 What is "Welcome" +1 + 1*2? Welcome 11*2 Welcome 11* 2 Welcome 12...
JAVA CODING: (14 points) Abstract Class exercise You are given two abstract classes with no abstract method in the NoGo.java file. The purpose of this exercise is to get familiar with abstract class and its object creation 4. Follow the steps below: (be sure common on each to score points) 1) 2) 3 points) Create a subclass Go1 with Nogo1 as its super class and create Go1() constructor 3) (2 points) Now inside the NoGo class create an instance of...
What is wrong with the following Java Code. public class TestEdible { abstract class Animal { /** Return animal sound */ public abstract String sound(); } class Chicken extends Animal implements Edible { @Override public String howToEat() { return "Chicken: Fry it"; } @Override public String sound() { return "Chicken: cock-a-doodle-doo"; } } class Tiger extends Animal { @Override public String sound() { return "Tiger: RROOAARR"; } } abstract class Fruit implements Edible { // Data fields, constructors, and methods...
java questions , help me and answer them please ! 6. Which of the following classes define a legal abstract class? 1: class A 2: abstract void unfinished 4: 1: public class abstract A 2: abstract void unfinished 1: class A 2: abstract void unfinished 3: 1: abstract class A 2: protected void unfinished 3: 1: abstract class A 2: abstract void unfinished 3: 1: class A 2: abstract int unfinished 3: 7. Suppose A is an interface. Can you...
Which two code fragments correctly create and initialize a static array of int elements? (Choose two.) A. static final intl] a100,200 B. static final int[l a; static { a=new int[2]; a[01-100; a[1]=200; } C. static final int[] a = new int[2]{ 100,200 }; D. static final intl a static void init() ( a new int[3] a[o] 100; a[11 200; Which two code fragments correctly create and initialize a static array of int elements? (Choose two.) A. static final intl] a100,200...
Question 1 (1 point) Saved Which of the following model is most abstract and is mostly an approximation to what it represents? 1) Analog 2) Symbolic -3) Physical 4) Quantitative Question 1 (1 point) Saved Which of the following model is most abstract and is mostly an approximation to what it represents? 1) Analog 2) Symbolic -3) Physical 4) Quantitative
Abstract classes and Interfaces problems 10. Explain one similarity and one difference between abstract classes and interfaces. 11. Consider the following declarations. public interface Shape{ int someFunction(Shape other); //other functions not shown } public class Square implements Shape {/*implementation not shown*/} Which of the following function headings of someFunction must be added to the declaration of the Square class such that it will satisfy the Shape interface? public int someFunction (Shape other) public int someFunction (Square other) public boolean someFunction(Object...
1) Consider the following Java program: 1 public class HelloWorld { 2 // My first program! 3 public static void main(String[] args) { 4 System.out.println("Hello, World!"); 5 } 6 } What is on line 1? a. a variable declaration b. a statement c. a method (subroutine) definition d. a comment e. a class definition 2) Which one of the following does NOT describe an array? a. It can be used in a for-each loop. b. It has a numbered sequence...
In java. You are provided an abstract class called MyAbstract. You can only modify the writeFile () class. You are provided another class called Finally you are provided the file you must read from in the MyAbstract class. You will need to extend MyAbstract to MyTestClass. You should have the following outputs. The content of myData employee avg salary number of employees File that was created in myFile() Everything I was provided is listed already. l. Servers ary 1 35...