Listing 4. shows modifications to the main method.
清单4 .显示了对main方法的修改。
Testing the main method does not work with all applications.
测试main方法并不作用于所有的应用程序。
Add a line to the main method creating a Vector called names.
在main方法中加入一行代码,创建名为names的Vector。
Now, when the main method runs, the output looks like that in Listing 6.
现在,main方法运行时,输出如清单6所示。
If all goes well, it is time to instantiate the class and run its main method.
如果一切正常,那么就可以实例化这个类并运行其main方法了。
The main method following the enumerated type definition demonstrates the usage.
位于枚举类型定义之后的main方法演示了这种用法。
We can just use the Server class main method and pass the arguments as an array of Strings.
我们可以使用server类主方法并传递一个字符串数组作为其参数。
We have demonstrated the use of the XmlEncryption class (Listing 11) through a main method.
我们已经通过main方法演示了xmlencryption类(清单11)的使用。
The result of running c's main method might surprise you — it'll issue a ClassCastException!
运行c的main方法的结果可能会让您吃惊—它将发出一个ClassCastException !
You can have separate launch configurations for any class with a main method in the project.
项目中有main方法的类都可以有单独的启动配置。
The main method then only puts NanoDelay objects into the queue and takes them out again.
然后main方法只是将NanoDelay对象放到队列中并再次将它们取出来。
Next, we need to add some code to the main method to instantiate the class and run the SWT code.
接着,我们需要向main方法添加一些代码,以便实例化该类并且运行SWT代码。
It is similar to having a class with a main method used for testing other classes in the package.
这类似于将一个具有主方法的类用于测试包中的其他类。
Now all you need to do is add code to the main method to delete any posts older than 30 days.
现在只需要把代码添加到main方法中来删除发布超过30天的所有post。
In those days, a skillfully placed main method was considered both agile and adequate for testing.
在那时,有技巧地放置main方法被视为灵活且适当的测试方法。
Listing 6 is the loadlib.h header file, which is used in the sources that call the main method.
清单6中是loadlib. h头文件,在调用main方法的源文件中使用了这个文件。
Some applications that do have a main method may not expect that method to be called more than once.
一些确实具有main方法的应用程序可能也不希望这个方法被不止一次的调用。
The OnInit function is called when your application starts — effectively, it's your main method.
应用程序开始时,调用OnInit函数——实际上是main方法。
It's the main thread that is implicitly created on process startup and executes the main method.
它是启动过程中隐式创建的主线程,执行main方法。
Now, when you run the main method, the Automobile object's toString output looks like Listing 8.
现在,运行main方法,Automobile对象的toString输出如清单8所示。
The main method, shown in Listing 2, creates a new instance of the class and calls the signOn method.
如清单2所示,main方法创建这个类的一个新的实例,并调用signOn方法。
I will use two code samples; first is an example of poorly structured code and has single Main method.
我会使用两个代码示例。第一个例子代码结构简陋,且只有一个单独的Main方法。
We need a main method to apply advice to our Example class, and print out some helpful status messages.
我们需要一个main方法将advice应用到我们的Example类,并打印出一些有帮助的状态消息。
Let's now turn our attention to the main method. It creates an event-handler object and a parser object.
现在,让我们将注意力转向main方法。
The first line inside the main method USES the same short-hand notation for map that we just examined.
main方法的第一行使用了和我们刚才产看过的map方法一样的简写。
Notice that in the configuration we set things to break automatically at the startup of our main method.
注意,在配置中,我们将设定调试程序在main方法启动时自动断开。
In a simple single-threaded application, 100 percent of the Tree time would be spent in the main method.
在一个简单的单线程应用程序中,100%的Tree时间将用于main方法。
Here, we have a class called Hello, where the main method merely creates an ApplicationWindow, then opens it.
这里我们创建了一个名为Hello的类,其中main方法仅仅创建了一个ApplicationWindow,然后打开它。
The static initializer runs first, as the class is loaded, followed by the main method (which is also static).
加载类之后,静态初始化器首先运行,紧接着运行的是main方法(也是静态的)。
This is an OSGi-specific piece of code which is invoked when the bundle is started, like a per-bundle main method.
下面是OSGi特定的代码片段,在bundle启动时被调用,有点像是bundle的main方法。
应用推荐