返回类型 - 方法返回的值的数据类型,如果方法未返回值,则返回void.
http://download.oracle.com/javase/tutorial/java/javaOO/methods.html
好的,那么..这是我的问题:
public class EnumTest {
Day day;
public EnumTest(Day day) {
this.day = day;
}
public void tellItLikeItIs() {
switch (day) {
case MONDAY: System.out.println("Mondays are bad.");
break;
case FRIDAY: System.out.println("Fridays are better.");
break;
case SATURDAY:
case SUNDAY: System.out.println("Weekends are best.");
break;
default: System.out.println("Midweek days are so-so.");
break;
}
}
public static void main(String[] args) {
EnumTest firstDay = new EnumTest(Day.MONDAY);
firstDay.tellItLikeItIs();
EnumTest thirdDay = new EnumTest(Day.WEDNESDAY);
thirdDay.tellItLikeItIs();
EnumTest fifthDay = new EnumTest(Day.FRIDAY);
fifthDay.tellItLikeItIs();
EnumTest sixthDay …Run Code Online (Sandbox Code Playgroud) 请考虑以下示例.他们的工作方式不同吗
.controller('MyController',function($scope) {
$scope.username = 'World';
$scope.sayHello = function() {
$scope.greeting = 'Hello ' + $scope.username + '!';
};
});
Run Code Online (Sandbox Code Playgroud)
VS
.controller('MyController', ['$scope', function($scope) {
$scope.username = 'World';
$scope.sayHello = function() {
$scope.greeting = 'Hello ' + $scope.username + '!';
};
}]);
Run Code Online (Sandbox Code Playgroud)
他们为我输出相同的内容,我只是不明白为什么我们把它放在那里.有时我必须把它作为工作的对象.为什么定义两次?
我从Wikipedia复制了以下代码:http : //en.wikipedia.org/wiki/Xlib
我收到此错误:
fatal error C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory
Run Code Online (Sandbox Code Playgroud)
我认为即使代码是c,它也适用于c ++,或者至少找到库x11?
一整天都被这个问题困扰着...有人知道我在做什么错吗?