Java naming conventions:
Class names: Capitalize the first letter in each name (Pascal).
Variables and method names: Lowercase the first word, capitalize the first letter in all subsequent words (camelCase).
Constants: Capitalize all letters.
#EC252
Class names: Capitalize the first letter in each name (Pascal).
Variables and method names: Lowercase the first word, capitalize the first letter in all subsequent words (camelCase).
Constants: Capitalize all letters.
#EC252
❤4
A call to a method with a void return type is always a statement itself, but a call to a value-returning method cannot be a statement by itself.
Anonymous Quiz
38%
True
62%
False
❤1
❤1
public class Person {
private string name;
private int age;
private int weight;
private int height;
public static Person (string name, int age) {
this.name = name;
this age = age;
weight = 0;
height = 0;
/// rest of code
}
}
is this sequence correct?
private string name;
private int age;
private int weight;
private int height;
public static Person (string name, int age) {
this.name = name;
this age = age;
weight = 0;
height = 0;
/// rest of code
}
}
is this sequence correct?
❤3
how many reference variables and objects are created by the following code?
Student studentName, studentId; studentName = new Student(); Student stud_class = new Student();
Student studentName, studentId; studentName = new Student(); Student stud_class = new Student();
Anonymous Quiz
42%
Three reference variables and two objects
36%
Two reference variables and two objects
17%
One reference variable and two objects
6%
Three reference variables and three objects
❤6