Java programming ideology (version 4) * Chapter 2 personal exercises and java programming ideology
Create a class that contains an int field and a char field. They are not initialized and printed out to verify that java performs the default initialization.
Public class DomTest {int I; char c; public DomTest () {System. out. println ("I =" + I + "\ nc = [" + c + "]" + "\ n []"); /*** print the following result: I = 0 c = [] [] // For comparison only. */}/*** @ param args */public static void main (String [] args) {new DomTest ();}}
Create a Hello, world program. This program only needs to output this sentence.
Public class DomTest {/*** @ param args */public static void main (String [] args) {System. out. println ("Hello, Word");}/*** running result Hello Word */}
Find the code segment containing ATypeName, rewrite it into a complete program, compile and run it.
Public class ATypeName {public static void main (String [] args) {System. out. println ("Hello Word") ;}/ *** running result Hello Word */}
Java programming ideas fourth edition Chapter 2 exercise questions
Exercise 2
//: C02: E02_ATypeName.java
// + M java E02_ATypeName
/***************** Exercise 2 ******************
* Find the code fragments involving ATypeName
* And turn them into a program that compiles and
* Runs.
**************************************** *******/
Public class E02_ATypeName {
Public static void main (String args []) {
E02_ATypeName a = new E02_ATypeName ();
}
}///:~
Who has the answer to the fourth edition of java programming ideas?
No one answered the question. Join the QQ group about JAVA or join the group about this book directly. They have answers. I am also a fan. I suggest using this!