![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 33 Pomógł: 0 Dołączył: 21.07.2011 Ostrzeżenie: (0%) ![]() ![]() |
Witam. Otoz mam taki maly kodzik
import java.util.*; public class cos{ public static void main(String[] args) { int[] tab=new int[100]; for(int i=0;i<10;i++) { tab[i]=i; } System.out.println(tab.length); char[] sl=new char[100]; String s="dasdasd"; sl=s.toCharArray(); System.out.println(sl.length); } } Dlaczego poprzez tab.length dla tablicy int wypisuje 100 a dla char 7 chociaz obydwie byly deklarowane na 100 miejsc? |
|
|
![]() ![]() |
![]() |
Aktualny czas: 24.08.2025 - 10:02 |