Big Data Java Foundation one

Source: Internet
Author: User
Tags array definition float double modifier

DataType
-------------
Basic data types
1.2 int
1.byte short int long float double
2.boolean[true,false]
3.char reference types
1.class
2.interface
3.[] Function
--------
function, methods, method
Encapsulates the function code.
Definitions cannot be nested. function format
---------
void parameter list
Modifier return value type function name (type 1 Name 1,...) {
function body
....
return;
} The invocation of the function
----------
function name () function overload (overload)
------------------
Recursive
----------

Array:
------------
Container with the same data type. Array definition
Number of------------elements = = Length of array
Type [] Variable name = new type [value];
int[] arr = net[10];
Arr.length;
Index out of bounds: java.lang.ArrayIndexOutOfBoundsException.
Null pointer exception: Java.lang.NullPointerExceptionjava no pointer
----------------
There is no explicit pointer operation. A reference is a pointer. The pointer is the memory address of the object.
NULL, the object does not exist, its properties and methods cannot be accessed, otherwise nullpointerexception.1. Define functions, Getmax (int[] arr), iterate through the array, and remove the maximum value of the int[] array.
int Getmax (int[] arr);
Network commands
-------------------
ipconfig//View IP Address
Ping 192.168.12.7//test whether the specified address is connected
Ping www.baidu.com//test the connectivity of the extranet
Ping www.baidu.com-t//test Network continuous connectivity
Class triangledemo{
public static void Ninexjiu () {
int line=9;
int row=1;
while (row<=9) {
int col=9;
while (Col >=row) {
System.out.print (col+ "*" +row+ "=" + (col *row) + "\ T");
col--;
}
row++;
System.out.println ();
}
}
public static int sum (int n) {
int sum=0;
for (int i=0;i<=100;i++) {
Sum=sum+i;
}
return sum;
System.out.println ("sum=" +sum);
}
public static void Ninexnine (int a) {
for (int x1=0;x1<=a;x1++) {
for (int y1=0;y1<=x1;y1++) {
System.out.print (x1+ "*" +y1+ "=" + (x1*y1) + "\ T");
}
System.out.println ();
}
}
public static void Main (string[] args) {
Triangledemo t=new Triangledemo ();
T.ninexnine ();
T.sum ();
Ninexjiu ();
Ninexnine (10);
System.out.println ("sum=" +sum (10));
}
}

 class   arrdemo{ public  static  void   main (string[] args) { int  [] Arr=new  int  [50 for  (int  x=0; x<arr.length;x++<                  Span style= "color: #000000") {arr[x]  =x+1;  for  (int  x=0;x<arr.length;x+ + "arr[" +x+ "]=" +arr[x]); 
    1. Classes and objects:
    2. 1, the basic idea of object-oriented. 2, class with object (declaration, creation, use). 3, member variables and methods (Declaration and application). 4, parameter passing (base data type and reference type).
    3. Method overloads:

      1, method overloading. 2, constructor. 3, the constructor reloads. The use of 4,this.

    4. Access rights:
    5. 1, the use of the package (Package,import). 2, access permission modifier. 3, the encapsulation of classes (privatization, seter and Geter). 4,static (static member variable, method, Class). 5,final (modifier variables, methods, classes)
    6. Inherit the 1 class inheritance concept. 2, member inheritance. The use of 3,super. 4, call the parent class constructor.
    7. Polymorphic: 1, method of rewriting and hiding. 2, the variable is hidden. 3, the use of inheritance to achieve polymorphism. 4, the type conversion under inheritance. 5,instanceof.

Big Data Java Foundation one

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.